platform/os2.c
changeset 763 efadd9cdb6a4
parent 754 e7cd7411eadf
child 808 7656f86a9a2c
--- a/platform/os2.c	Mon Nov 28 13:28:33 2005 +0000
+++ b/platform/os2.c	Sun Jan 01 12:19:44 2006 +0000
@@ -757,9 +757,7 @@
 
 void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s)
 {
-    /* make sure s isn't larger than the address space of the platform... */
-    if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
-        BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
+    BAIL_IF_MACRO(__PHYSFS_ui64FitsAddressSpace(s), ERR_OUT_OF_MEMORY, NULL);
     #undef malloc
     return(malloc((size_t) s));
 } /* __PHYSFS_platformMalloc */
@@ -767,9 +765,7 @@
 
 void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
 {
-    /* make sure s isn't larger than the address space of the platform... */
-    if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
-        BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
+    BAIL_IF_MACRO(__PHYSFS_ui64FitsAddressSpace(s), ERR_OUT_OF_MEMORY, NULL);
     #undef realloc
     return(realloc(ptr, (size_t) s));
 } /* __PHYSFS_platformRealloc */