equal
deleted
inserted
replaced
670 { |
670 { |
671 /* no-op */ |
671 /* no-op */ |
672 } /* __PHYSFS_platformAllocatorInit */ |
672 } /* __PHYSFS_platformAllocatorInit */ |
673 |
673 |
674 |
674 |
675 void *__PHYSFS_platformAllocatorMalloc(size_t s) |
675 void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s) |
676 { |
676 { |
|
677 /* make sure s isn't larger than the address space of the platform... */ |
|
678 if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) ) |
|
679 BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL); |
677 #undef malloc |
680 #undef malloc |
678 return(malloc(s)); |
681 return(malloc((size_t) s)); |
679 } /* __PHYSFS_platformMalloc */ |
682 } /* __PHYSFS_platformMalloc */ |
680 |
683 |
681 |
684 |
682 void *__PHYSFS_platformAllocatorRealloc(void *ptr, size_t s) |
685 void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s) |
683 { |
686 { |
|
687 /* make sure s isn't larger than the address space of the platform... */ |
|
688 if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) ) |
|
689 BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL); |
684 #undef realloc |
690 #undef realloc |
685 return(realloc(ptr, s)); |
691 return(realloc(ptr, (size_t) s)); |
686 } /* __PHYSFS_platformRealloc */ |
692 } /* __PHYSFS_platformRealloc */ |
687 |
693 |
688 |
694 |
689 void __PHYSFS_platformAllocatorFree(void *ptr) |
695 void __PHYSFS_platformAllocatorFree(void *ptr) |
690 { |
696 { |