[tuhopuu-cvs] CVS commit: tuhopuu3/intern/guardedalloc MEM_guardedalloc.h tuhopuu3/intern/guardedalloc/intern mallocn.c tuhopuu3/source nan_compile.mk tuhopuu3/source/blender/python/api2_2x Ipocurve.c
Chris Want
cwant at ualberta.ca
Sat Aug 20 08:59:27 CEST 2005
hos (Chris Want) 2005/08/20 08:59:27 CEST
Modified files:
tuhopuu3/intern/guardedalloc MEM_guardedalloc.h
tuhopuu3/intern/guardedalloc/intern mallocn.c
tuhopuu3/source nan_compile.mk
tuhopuu3/source/blender/python/api2_2x Ipocurve.c
Log:
Mega memory debugging modes (don't know how useful this is, but
might be interesting to somebody).
If you do:
export NAN_MEGA_MEM_DEBUG=true
before a clean build, the behavior of the MEM_[mc]allocN and
MEM_FreeN memory functions change so that it prints what
file, line, function, address, etc was involved with
the memory operation. This outputs a *lot* of info and
is probably useful when used with grep -v.
Example (heavily pared down) output might look like:
MA(interface.c:1001, 24 bytes) menudata_new(): 88726e4, MenuData
MA(interface.c:1024, 12 bytes) menudata_add_item(): 8868b94, md->items
MA(interface.c:1024, 24 bytes) menudata_add_item(): 8868bcc, md->items
FR(interface.c:1027) menudata_add_item(): 8868b94
FR(interface.c:1040) menudata_free(): 8871b54
FR(interface.c:1042) menudata_free(): 8868bcc
FR(interface.c:1043) menudata_free(): 88726e4
Here, MA is a malloc, and FR is free (there is also CA for calloc).
There are actually two parts of this memory debug mode, one for
alloc-ing and the other for free-ing which can be used independently
if desired with:
export NAN_MEGA_ALLOC_DEBUG=true
export NAN_MEGA_FREE_DEBUG=true
Note: this uses the macro __FUNCTION__ that might not be
available on all platforms.
Revision Changes Path
1.2 +20 -4 tuhopuu3/intern/guardedalloc/MEM_guardedalloc.h
<http://projects.blender.org/viewcvs/viewcvs.cgi/tuhopuu3/intern/guardedalloc/MEM_guardedalloc.h.diff?r1=1.1&r2=1.2&cvsroot=tuhopuu>
1.2 +74 -15 tuhopuu3/intern/guardedalloc/intern/mallocn.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/tuhopuu3/intern/guardedalloc/intern/mallocn.c.diff?r1=1.1&r2=1.2&cvsroot=tuhopuu>
1.11 +15 -1 tuhopuu3/source/nan_compile.mk
<http://projects.blender.org/viewcvs/viewcvs.cgi/tuhopuu3/source/nan_compile.mk.diff?r1=1.10&r2=1.11&cvsroot=tuhopuu>
1.2 +130 -47 tuhopuu3/source/blender/python/api2_2x/Ipocurve.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/tuhopuu3/source/blender/python/api2_2x/Ipocurve.c.diff?r1=1.1&r2=1.2&cvsroot=tuhopuu>
More information about the tuhopuu-cvs
mailing list