platform/pocketpc.c
changeset 763 efadd9cdb6a4
parent 754 e7cd7411eadf
child 792 4c278733e281
equal deleted inserted replaced
762:63f2585b5a5e 763:efadd9cdb6a4
   673 } /* __PHYSFS_platformAllocatorInit */
   673 } /* __PHYSFS_platformAllocatorInit */
   674 
   674 
   675 
   675 
   676 void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s)
   676 void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s)
   677 {
   677 {
   678     /* make sure s isn't larger than the address space of the platform... */
   678     BAIL_IF_MACRO(__PHYSFS_ui64FitsAddressSpace(s), ERR_OUT_OF_MEMORY, NULL);
   679     if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
       
   680         BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
       
   681     #undef malloc
   679     #undef malloc
   682     return(malloc((size_t) s));
   680     return(malloc((size_t) s));
   683 } /* __PHYSFS_platformMalloc */
   681 } /* __PHYSFS_platformMalloc */
   684 
   682 
   685 
   683 
   686 void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
   684 void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
   687 {
   685 {
   688     /* make sure s isn't larger than the address space of the platform... */
   686     BAIL_IF_MACRO(__PHYSFS_ui64FitsAddressSpace(s), ERR_OUT_OF_MEMORY, NULL);
   689     if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
       
   690         BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
       
   691     #undef realloc
   687     #undef realloc
   692     return(realloc(ptr, (size_t) s));
   688     return(realloc(ptr, (size_t) s));
   693 } /* __PHYSFS_platformRealloc */
   689 } /* __PHYSFS_platformRealloc */
   694 
   690 
   695 
   691