From c2c1c7ac304c0e091fe34c88a85d96503f3dba2f Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 11 Jul 2017 23:52:13 -0400 Subject: [PATCH] Removed __PHYSFS_platformSetDefaultAllocator(); nothing uses it now. We can pull it back from revision control if something needs it later. --- src/physfs.c | 13 +++++-------- src/physfs_internal.h | 14 -------------- src/platform_beos.cpp | 6 ------ src/platform_macosx.c | 6 ------ src/platform_os2.c | 7 ------- src/platform_unix.c | 6 ------ src/platform_windows.c | 7 ------- src/platform_winrt.cpp | 9 +-------- 8 files changed, 6 insertions(+), 62 deletions(-) diff --git a/src/physfs.c b/src/physfs.c index deb5075..b6b5e55 100644 --- a/src/physfs.c +++ b/src/physfs.c @@ -3002,14 +3002,11 @@ static void mallocAllocatorFree(void *ptr) static void setDefaultAllocator(void) { assert(!externalAllocator); - if (!__PHYSFS_platformSetDefaultAllocator(&allocator)) - { - allocator.Init = NULL; - allocator.Deinit = NULL; - allocator.Malloc = mallocAllocatorMalloc; - allocator.Realloc = mallocAllocatorRealloc; - allocator.Free = mallocAllocatorFree; - } /* if */ + allocator.Init = NULL; + allocator.Deinit = NULL; + allocator.Malloc = mallocAllocatorMalloc; + allocator.Realloc = mallocAllocatorRealloc; + allocator.Free = mallocAllocatorFree; } /* setDefaultAllocator */ /* end of physfs.c ... */ diff --git a/src/physfs_internal.h b/src/physfs_internal.h index 591a8cc..a53d8c5 100644 --- a/src/physfs_internal.h +++ b/src/physfs_internal.h @@ -655,20 +655,6 @@ int __PHYSFS_platformGrabMutex(void *mutex); */ void __PHYSFS_platformReleaseMutex(void *mutex); -/* - * Called at the start of PHYSFS_init() to prepare the allocator, if the user - * hasn't selected their own allocator via PHYSFS_setAllocator(). - * If the platform has a custom allocator, it should fill in the fields of - * (a) with the proper function pointers and return non-zero. - * If the platform just wants to use malloc()/free()/etc, return zero - * immediately and the higher level will handle it. The Init and Deinit - * fields of (a) are optional...set them to NULL if you don't need them. - * Everything else must be implemented. All rules follow those for - * PHYSFS_setAllocator(). If Init isn't NULL, it will be called shortly - * after this function returns non-zero. - */ -int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a); - #ifdef __cplusplus } #endif diff --git a/src/platform_beos.cpp b/src/platform_beos.cpp index 12ea992..3376c46 100644 --- a/src/platform_beos.cpp +++ b/src/platform_beos.cpp @@ -227,12 +227,6 @@ void __PHYSFS_platformReleaseMutex(void *mutex) ((BLocker *) mutex)->Unlock(); } /* __PHYSFS_platformReleaseMutex */ - -int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a) -{ - return 0; /* just use malloc() and friends. */ -} /* __PHYSFS_platformSetDefaultAllocator */ - #endif /* PHYSFS_PLATFORM_BEOS */ /* end of beos.cpp ... */ diff --git a/src/platform_macosx.c b/src/platform_macosx.c index b1b1c8a..e6b2739 100644 --- a/src/platform_macosx.c +++ b/src/platform_macosx.c @@ -212,12 +212,6 @@ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) return retval; } /* __PHYSFS_platformCalcPrefDir */ - -int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a) -{ - return 0; /* just use malloc() and friends. */ -} /* __PHYSFS_platformSetDefaultAllocator */ - #endif /* PHYSFS_PLATFORM_MACOSX */ /* end of macosx.c ... */ diff --git a/src/platform_os2.c b/src/platform_os2.c index 942702f..3719346 100644 --- a/src/platform_os2.c +++ b/src/platform_os2.c @@ -773,13 +773,6 @@ void __PHYSFS_platformReleaseMutex(void *mutex) DosReleaseMutexSem((HMTX) mutex); } /* __PHYSFS_platformReleaseMutex */ - -/* !!! FIXME: Don't use C runtime for allocators? */ -int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a) -{ - return 0; /* just use malloc() and friends. */ -} /* __PHYSFS_platformSetDefaultAllocator */ - #endif /* PHYSFS_PLATFORM_OS2 */ /* end of os2.c ... */ diff --git a/src/platform_unix.c b/src/platform_unix.c index a60fcb4..891f1b2 100644 --- a/src/platform_unix.c +++ b/src/platform_unix.c @@ -367,12 +367,6 @@ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app) return retval; } /* __PHYSFS_platformCalcPrefDir */ - -int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a) -{ - return 0; /* just use malloc() and friends. */ -} /* __PHYSFS_platformSetDefaultAllocator */ - #endif /* PHYSFS_PLATFORM_UNIX */ /* end of unix.c ... */ diff --git a/src/platform_windows.c b/src/platform_windows.c index 77e9ef1..f582333 100644 --- a/src/platform_windows.c +++ b/src/platform_windows.c @@ -945,13 +945,6 @@ int __PHYSFS_platformStat(const char *filename, PHYSFS_Stat *st) return 1; } /* __PHYSFS_platformStat */ - -/* !!! FIXME: Don't use C runtime for allocators? */ -int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a) -{ - return 0; /* just use malloc() and friends. */ -} /* __PHYSFS_platformSetDefaultAllocator */ - #endif /* PHYSFS_PLATFORM_WINDOWS */ #endif /* PHYSFS_PLATFORM_WINRT */ diff --git a/src/platform_winrt.cpp b/src/platform_winrt.cpp index 8e59dab..3190cc0 100644 --- a/src/platform_winrt.cpp +++ b/src/platform_winrt.cpp @@ -665,12 +665,5 @@ int __PHYSFS_platformStat(const char *filename, PHYSFS_Stat *st) return 1; } /* __PHYSFS_platformStat */ +#endif /* PHYSFS_PLATFORM_WINRT */ -/* !!! FIXME: Don't use C runtime for allocators? */ -int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a) -{ - return 0; /* just use malloc() and friends. */ -} /* __PHYSFS_platformSetDefaultAllocator */ - - -#endif /* PHYSFS_PLATFORM_WINRT */ \ No newline at end of file