|
@@ -4,23 +4,24 @@
|
|
|
#define SIZEALIGN 16
|
|
|
#define ALIGNMASK (SIZEALIGN-1)
|
|
|
|
|
|
-//Allocates mem on 16 byte aligned boundary.
|
|
|
-//
|
|
|
-//Used by (some) GC routines to allocate large chunks, and GC mem needs to be on 16 byte boundary for
|
|
|
-//mem bit flags system in ref couter/Mark Sibly GCs...
|
|
|
-//
|
|
|
+/* use malloc/free() in Debug mode, otherwise use the GC heap */
|
|
|
void *bbMemAlloc( size_t size ){
|
|
|
void *p;
|
|
|
-
|
|
|
+#ifdef BMX_DEBUG
|
|
|
p=malloc( size );
|
|
|
- //p=GC_MALLOC_ATOMIC_UNCOLLECTABLE( size );
|
|
|
+#else
|
|
|
+ p=GC_MALLOC_ATOMIC_UNCOLLECTABLE( size );
|
|
|
+#endif
|
|
|
return p;
|
|
|
|
|
|
}
|
|
|
|
|
|
void bbMemFree( void *p ){
|
|
|
- //if( p ) GC_free( p );
|
|
|
+#ifdef BMX_DEBUG
|
|
|
if ( p ) free(p);
|
|
|
+#else
|
|
|
+ if( p ) GC_free( p );
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
void *bbMemExtend( void *mem,size_t size,size_t new_size ){
|