platform/skeleton.c
changeset 747 3da194b12f43
parent 691 71d9affe0d8a
child 754 e7cd7411eadf
equal deleted inserted replaced
746:88780f7156d3 747:3da194b12f43
   244 {
   244 {
   245     /* no-op */
   245     /* no-op */
   246 } /* __PHYSFS_platformAllocatorInit */
   246 } /* __PHYSFS_platformAllocatorInit */
   247 
   247 
   248 
   248 
   249 void *__PHYSFS_platformAllocatorMalloc(size_t s)
   249 void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s)
   250 {
   250 {
       
   251     /* make sure s isn't larger than the address space of the platform... */
       
   252     if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
       
   253         BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
   251     #undef malloc
   254     #undef malloc
   252     return(malloc(s));
   255     return(malloc((size_t) s));
   253 } /* __PHYSFS_platformMalloc */
   256 } /* __PHYSFS_platformMalloc */
   254 
   257 
   255 
   258 
   256 void *__PHYSFS_platformAllocatorRealloc(void *ptr, size_t s)
   259 void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
   257 {
   260 {
       
   261     /* make sure s isn't larger than the address space of the platform... */
       
   262     if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
       
   263         BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
   258     #undef realloc
   264     #undef realloc
   259     return(realloc(ptr, s));
   265     return(realloc(ptr, (size_t) s));
   260 } /* __PHYSFS_platformRealloc */
   266 } /* __PHYSFS_platformRealloc */
   261 
   267 
   262 
   268 
   263 void __PHYSFS_platformAllocatorFree(void *ptr)
   269 void __PHYSFS_platformAllocatorFree(void *ptr)
   264 {
   270 {