diff --git a/Headers/Foundation/NSZone.h b/Headers/Foundation/NSZone.h index b9570faf6..b8c6f1a64 100644 --- a/Headers/Foundation/NSZone.h +++ b/Headers/Foundation/NSZone.h @@ -30,28 +30,6 @@ #define __NSZone_h_GNUSTEP_BASE_INCLUDE #import "GNUstepBase/GSVersionMacros.h" -/** - * Primary structure representing an NSZone. Technically it - * consists of a set of function pointers for zone upkeep functions plus some - * other things- - -{ - // Functions for zone. - void *(*malloc)(struct _NSZone *zone, size_t size); - void *(*realloc)(struct _NSZone *zone, void *ptr, size_t size); - void (*free)(struct _NSZone *zone, void *ptr); - void (*recycle)(struct _NSZone *zone); - BOOL (*check)(struct _NSZone *zone); - BOOL (*lookup)(struct _NSZone *zone, void *ptr); - - // Zone statistics (not always maintained). - struct NSZoneStats (*stats)(struct _NSZone *zone); - - size_t gran; // Zone granularity (passed in on initialization) - NSString *name; // Name of zone (default is 'nil') - NSZone *next; // Pointer used for internal management of multiple zones. -} - */ typedef struct _NSZone NSZone; #import @@ -62,22 +40,6 @@ typedef struct _NSZone NSZone; extern "C" { #endif -struct _NSZone -{ - /* Functions for zone. */ - void *(*malloc)(struct _NSZone *zone, size_t size); - void *(*realloc)(struct _NSZone *zone, void *ptr, size_t size); - void (*free)(struct _NSZone *zone, void *ptr); - void (*recycle)(struct _NSZone *zone); - BOOL (*check)(struct _NSZone *zone); - BOOL (*lookup)(struct _NSZone *zone, void *ptr); - struct NSZoneStats (*stats)(struct _NSZone *zone); - - size_t gran; // Zone granularity - __unsafe_unretained NSString *name; // Name of zone (default is 'nil') - NSZone *next; -}; - /** * Creates a new zone of start bytes, which will grow and shrink by * granularity bytes. If canFree is 0, memory in zone is allocated but diff --git a/Source/NSZone.m b/Source/NSZone.m index 0116aa7ff..a6fc91a28 100644 --- a/Source/NSZone.m +++ b/Source/NSZone.m @@ -93,6 +93,47 @@ #import "GSPrivate.h" #import "GSPThread.h" +/** + * Primary structure representing an NSZone. Technically it + * consists of a set of function pointers for zone upkeep functions plus some + * other things- + +{ + // Functions for zone. + void *(*malloc)(struct _NSZone *zone, size_t size); + void *(*realloc)(struct _NSZone *zone, void *ptr, size_t size); + void (*free)(struct _NSZone *zone, void *ptr); + void (*recycle)(struct _NSZone *zone); + BOOL (*check)(struct _NSZone *zone); + BOOL (*lookup)(struct _NSZone *zone, void *ptr); + + // Zone statistics (not always maintained). + struct NSZoneStats (*stats)(struct _NSZone *zone); + + size_t gran; // Zone granularity (passed in on initialization) + NSString *name; // Name of zone (default is 'nil') + NSZone *next; // Pointer used for internal management of multiple zones. +} + */ + +struct _NSZone +{ + /* Functions for zone. */ + void *(*malloc)(struct _NSZone *zone, size_t size); + void *(*realloc)(struct _NSZone *zone, void *ptr, size_t size); + void (*free)(struct _NSZone *zone, void *ptr); + void (*recycle)(struct _NSZone *zone); + BOOL (*check)(struct _NSZone *zone); + BOOL (*lookup)(struct _NSZone *zone, void *ptr); + struct NSZoneStats (*stats)(struct _NSZone *zone); + + size_t gran; // Zone granularity + __unsafe_unretained NSString *name; // Name of zone (default is 'nil') + NSZone *next; +}; + + + static gs_mutex_t zoneLock = GS_MUTEX_INIT_STATIC; /**