Changeset 136 for trunk/nom/src/nommemory.c
- Timestamp:
- Dec 3, 2006, 10:08:56 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nom/src/nommemory.c
r94 r136 46 46 #include <nomtk.h> 47 47 48 /* This tells us if memory allocation is done using the garbage collector */ 49 extern gboolean bUseGC; /* Set during initialization */ 50 48 51 NOMEXTERN nomToken NOMLINK NOMMalloc(ULONG size) 49 52 { … … 63 66 64 67 if((memPtr=g_malloc(size*num + sizeof(ULONG)))==NULLHANDLE) 65 return NULLHANDLE; 66 memset(memPtr, 0, size*num + sizeof(ULONG)); 68 return NULLHANDLE; /* We won't end here because GLib just terminates the process :-/ 69 A really sick idea imho. */ 70 if(!bUseGC) 71 memset(memPtr, 0, size*num + sizeof(ULONG)); /* GC always returns zeroed memory */ 72 67 73 *memPtr=size; 68 74 memPtr++;
Note:
See TracChangeset
for help on using the changeset viewer.