@@ -12,10 +12,11 @@ #include "config.h" #include #include #include +#include #include #include #import "OFObject.h" #import "OFAutoreleasePool.h" @@ -27,10 +28,14 @@ # import #endif #ifdef OF_GNU_RUNTIME # import #endif + +#ifdef _WIN32 +# include +#endif #ifdef OF_ATOMIC_OPS # import "atomic.h" #else # import "threading.h" @@ -59,10 +64,12 @@ #define PRE_IVAR ((struct pre_ivar*)((char*)self - PRE_IVAR_ALIGN)) static struct { Class isa; } alloc_failed_exception; + +size_t of_pagesize; #ifdef NEED_OBJC_SYNC_INIT extern BOOL objc_sync_init(); #endif @@ -103,10 +110,19 @@ #endif #ifdef OF_APPLE_RUNTIME objc_setEnumerationMutationHandler(enumeration_mutation_handler); #endif + +#ifndef _WIN32 + if ((of_pagesize = sysconf(_SC_PAGESIZE)) < 1) + of_pagesize = 4096; +#else + SYSTEM_INFO si; + GetSystemInfo(&si); + of_pagesize = si.dwPageSize; +#endif } + (void)initialize { }