--- a/platform/skeleton.c Mon Nov 28 13:28:33 2005 +0000
+++ b/platform/skeleton.c Sun Jan 01 12:19:44 2006 +0000
@@ -249,9 +249,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 */
@@ -259,9 +257,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 */