diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index be812fa8b0a8267b90d75ed700998a43ef273a1f..31007a22470c64e61f0ab8b5bf45b51a4fa8d93f 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -4607,11 +4607,11 @@ svn commit @node Source code structure, Coding style, Getting the source, Information for developers @section Source code structure -Gmsh's code is structured in several libraries, roughly separated -between the three main core modules (@file{Geo}, @file{Mesh}, -@file{Post}) and associated utility libraries (@file{Common}, -@file{Numeric}) on one hand, and graphics (@file{Graphics}) and -interface (@file{Fltk}, @file{Parser}) libraries on the other. +Gmsh's code is structured in several subdirectories, roughly separated +between the four core modules (@file{Geo}, @file{Mesh}, @file{Solver}, +@file{Post}) and associated utilities (@file{Common}, @file{Numeric}) on +one hand, and the graphics (@file{Graphics}) and interface (@file{Fltk}, +@file{Parser}) code on the other. The geometry and mesh modules are based on an object-oriented model class (@file{Geo/GModel.h}), built upon abstract geometrical entity @@ -4636,14 +4636,43 @@ to make the code easy to read/debug/maintain: @enumerate @item -please enable full warnings for your compiler (e.g., add @code{-Wall} to -@code{FLAGS} in the @file{variables} file); +Please enable full warnings for your compiler (e.g. @code{-Wall} with +@code{g++}) and don't commit until there is no warning left. @item -always use the @code{Msg::} class to print information, errors, @dots{}; +Use memory checking tools to detect memory leaks and other nasty memory +problems. For example, you can use +@itemize @bullet +@item +Valgrind on Linux: +@example +valgrind --leak-check=yes --show-reachable=yes gmsh file.geo -3 +@end example +@item +GMALLOC on Mac OS X: +@example +(gdb) set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.dylib +@end example @item -indent your files (2 spaces) +LIBNJAMD: +@example +export LD_PRELOAD=libnjamd.so +kill -USR1 +@end example +@item +Purify +@item +Memprof +@item +@dots{} +@end itemize +@item +always use the @code{Msg::} class to print information or errors @item -convert all tabs to spaces. +indent your files (2 spaces) and convert all tabs to spaces +@item +follow the style used in the existing code when adding something new +(spaces after commas, opening braces for functions on a separate line, +opening braces for loops and tests on the same line, etc.) @end enumerate @c ------------------------------------------------------------------------- @@ -4672,23 +4701,18 @@ add the prototype in @file{Common/Options.h}); optional: create the associated widget in @file{Fltk/optionWindow.cpp}; @end enumerate -@c todo: -@c Tools to check memory leaks -@c * on mac: use GMALLOC -@c (gdb) set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.dylib -@c * LIBNJAMD -@c export LD_PRELOAD=libnjamd.so -@c kill -USR1 -@c * valgrind --leak-check=yes --show-reachable=yes gmsh file.geo -3 -@c * purify -@c * memprof -@c +@c ------------------------------------------------------------------------- +@c Using Gmsh as a library +@c ------------------------------------------------------------------------- + +@c @node Using Gmsh as a library, , Coding style, Information for developers +@c @section Using Gmsh as a library + @c Notes on thread-safety @c All the operations in the Gmsh library are not thread safe. @c For example, the MeshAdapt algorithm is, while the Delaunay/Frontal @c are not. - @c ------------------------------------------------------------------------- @c Compiling with OpenCASCADE @c -------------------------------------------------------------------------