On Thu, 2009-02-12 at 06:51 -0800, Daniel Stone wrote: > On Thu, Feb 12, 2009 at 11:02:22AM +0000, José Fonseca wrote: > > I'd like to fix the naming collisions for the memory allocation utility > > macros/functions between gallium & mesa, especially the MALLOC, CALLOC, > > CALLOC_STRUCT, FREE, and REALLOC macros in u_memory.[ch]. > > > > The main motivation is to be able to use the memory debugging functions > > debug_malloc, etc instead of the standard library's ones. The mesa > > based state tracker sometimes frees mesa structures (allocated with > > malloc), with debug_free, and probably vice versa. > > > > I don't have any particular preference for Gallium memory allocation > > functions, as long as they are different from mesa. We could go for the > > trend of prefixing with the module name (util_malloc, util_free, etc). > > Or we could go for using some Gallium globally unique prefix > > (ga3d_malloc, or ga_malloc). What you do you think? > > Why not just use malloc/calloc/free and wrap them with LD_PRELOAD? That > way you don't have the confusion between internally- and > externally-allocated pointers.
That would solve Linux problem, but not Windows'. Actually, Linux has valgrind, so there is no need to use these home-made memory debugging techniques. However there is nothing nearly as powerful and effective as valgrind on Windows unfortunately.. Jose ------------------------------------------------------------------------------ _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
