platform/macclassic.c
changeset 747 3da194b12f43
parent 701 49a5ec86b8b3
child 754 e7cd7411eadf
equal deleted inserted replaced
746:88780f7156d3 747:3da194b12f43
   937 {
   937 {
   938     /* no-op */
   938     /* no-op */
   939 } /* __PHYSFS_platformAllocatorInit */
   939 } /* __PHYSFS_platformAllocatorInit */
   940 
   940 
   941 
   941 
   942 void *__PHYSFS_platformAllocatorMalloc(size_t s)
   942 void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s)
   943 {
   943 {
       
   944     /* make sure s isn't larger than the address space of the platform... */
       
   945     if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
       
   946         BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
   944     #undef malloc
   947     #undef malloc
   945     return(malloc(s));
   948     return(malloc((size_t) s));
   946 } /* __PHYSFS_platformMalloc */
   949 } /* __PHYSFS_platformMalloc */
   947 
   950 
   948 
   951 
   949 void *__PHYSFS_platformAllocatorRealloc(void *ptr, size_t s)
   952 void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
   950 {
   953 {
       
   954     /* make sure s isn't larger than the address space of the platform... */
       
   955     if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
       
   956         BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
   951     #undef realloc
   957     #undef realloc
   952     return(realloc(ptr, s));
   958     return(realloc(ptr, (size_t) s));
   953 } /* __PHYSFS_platformRealloc */
   959 } /* __PHYSFS_platformRealloc */
   954 
   960 
   955 
   961 
   956 void __PHYSFS_platformAllocatorFree(void *ptr)
   962 void __PHYSFS_platformAllocatorFree(void *ptr)
   957 {
   963 {