@@ -18,10 +18,11 @@ #include #include #import "OFObject.h" +#import "OFSystemInfo.h" #ifndef OF_COMPILER_TLS # import "threading.h" #endif #import "macros.h" @@ -92,14 +93,15 @@ id *objects = of_tlskey_get(objectsKey); size_t size = (size_t)(uintptr_t)of_tlskey_get(sizeKey); #endif if (objects == NULL) { - OF_ENSURE((objects = malloc(of_pagesize)) != NULL); + size = [OFSystemInfo pageSize]; + + OF_ENSURE((objects = malloc(size)) != NULL); top = objects; - size = of_pagesize; #ifndef OF_COMPILER_TLS OF_ENSURE(of_tlskey_set(objectsKey, objects)); OF_ENSURE(of_tlskey_set(sizeKey, (void*)(uintptr_t)size)); #endif @@ -106,11 +108,11 @@ } if ((uintptr_t)top >= (uintptr_t)objects + size) { ptrdiff_t diff = top - objects; - size += of_pagesize; + size += [OFSystemInfo pageSize]; OF_ENSURE((objects = realloc(objects, size)) != NULL); #ifndef OF_COMPILER_TLS OF_ENSURE(of_tlskey_set(objectsKey, objects)); OF_ENSURE(of_tlskey_set(sizeKey, (void*)(uintptr_t)size));