platform/win32.c
changeset 747 3da194b12f43
parent 691 71d9affe0d8a
child 748 e400ca09da17
equal deleted inserted replaced
746:88780f7156d3 747:3da194b12f43
  1120 {
  1120 {
  1121     /* no-op */
  1121     /* no-op */
  1122 } /* __PHYSFS_platformAllocatorInit */
  1122 } /* __PHYSFS_platformAllocatorInit */
  1123 
  1123 
  1124 
  1124 
  1125 void *__PHYSFS_platformAllocatorMalloc(size_t s)
  1125 void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s)
  1126 {
  1126 {
       
  1127     /* make sure s isn't larger than the address space of the platform... */
       
  1128     if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
       
  1129         BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
  1127     #undef malloc
  1130     #undef malloc
  1128     return(malloc(s));
  1131     return(malloc((size_t) s));
  1129 } /* __PHYSFS_platformMalloc */
  1132 } /* __PHYSFS_platformMalloc */
  1130 
  1133 
  1131 
  1134 
  1132 void *__PHYSFS_platformAllocatorRealloc(void *ptr, size_t s)
  1135 void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
  1133 {
  1136 {
       
  1137     /* make sure s isn't larger than the address space of the platform... */
       
  1138     if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
       
  1139         BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
  1134     #undef realloc
  1140     #undef realloc
  1135     return(realloc(ptr, s));
  1141     return(realloc(ptr, (size_t) s));
  1136 } /* __PHYSFS_platformRealloc */
  1142 } /* __PHYSFS_platformRealloc */
  1137 
  1143 
  1138 
  1144 
  1139 void __PHYSFS_platformAllocatorFree(void *ptr)
  1145 void __PHYSFS_platformAllocatorFree(void *ptr)
  1140 {
  1146 {