diff --git a/ChangeLog b/ChangeLog index 0eb4bca76..77a03efe9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ * Source/GSSocketStream.m: Avoid unnecessary memory allocation. Use weak pointers to break finalisation cycles. + * Source/NSZone.m: Use GC debug unless built with 'debug=no' + Allocate memory ignoring pointers into the allocated data. 2009-03-21 Richard Frith-Macdonald diff --git a/Source/NSZone.m b/Source/NSZone.m index 13732f298..d71bda6e5 100644 --- a/Source/NSZone.m +++ b/Source/NSZone.m @@ -1753,6 +1753,10 @@ NSReallocateCollectable(void *ptr, NSUInteger size, NSUInteger options) } #else +#if defined(DEBUG) +#define GC_DEBUG 1 +#endif + #include /* @@ -1784,7 +1788,7 @@ NSAllocateCollectable(NSUInteger size, NSUInteger options) } else { - ptr = (void*)GC_MALLOC(size); + ptr = (void*)GC_MALLOC_IGNORE_OFF_PAGE(size); memset(ptr, '\0', size); } } @@ -1796,7 +1800,7 @@ NSAllocateCollectable(NSUInteger size, NSUInteger options) } else { - ptr = (void*)GC_MALLOC_ATOMIC(size); + ptr = (void*)GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE(size); memset(ptr, '\0', size); } }