platform/os2.c
changeset 747 3da194b12f43
parent 717 ae8bc9888553
child 754 e7cd7411eadf
equal deleted inserted replaced
746:88780f7156d3 747:3da194b12f43
   752 {
   752 {
   753     /* no-op */
   753     /* no-op */
   754 } /* __PHYSFS_platformAllocatorInit */
   754 } /* __PHYSFS_platformAllocatorInit */
   755 
   755 
   756 
   756 
   757 void *__PHYSFS_platformAllocatorMalloc(size_t s)
   757 void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s)
   758 {
   758 {
       
   759     /* make sure s isn't larger than the address space of the platform... */
       
   760     if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
       
   761         BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
   759     #undef malloc
   762     #undef malloc
   760     return(malloc(s));
   763     return(malloc((size_t) s));
   761 } /* __PHYSFS_platformMalloc */
   764 } /* __PHYSFS_platformMalloc */
   762 
   765 
   763 
   766 
   764 void *__PHYSFS_platformAllocatorRealloc(void *ptr, size_t s)
   767 void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
   765 {
   768 {
       
   769     /* make sure s isn't larger than the address space of the platform... */
       
   770     if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
       
   771         BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
   766     #undef realloc
   772     #undef realloc
   767     return(realloc(ptr, s));
   773     return(realloc(ptr, (size_t) s));
   768 } /* __PHYSFS_platformRealloc */
   774 } /* __PHYSFS_platformRealloc */
   769 
   775 
   770 
   776 
   771 void __PHYSFS_platformAllocatorFree(void *ptr)
   777 void __PHYSFS_platformAllocatorFree(void *ptr)
   772 {
   778 {