Removed __PHYSFS_platformSetDefaultAllocator(); nothing uses it now.
We can pull it back from revision control if something needs it later.
This commit is contained in:
parent
0be0e3fd33
commit
c2c1c7ac30
13
src/physfs.c
13
src/physfs.c
|
@ -3002,14 +3002,11 @@ static void mallocAllocatorFree(void *ptr)
|
||||||
static void setDefaultAllocator(void)
|
static void setDefaultAllocator(void)
|
||||||
{
|
{
|
||||||
assert(!externalAllocator);
|
assert(!externalAllocator);
|
||||||
if (!__PHYSFS_platformSetDefaultAllocator(&allocator))
|
allocator.Init = NULL;
|
||||||
{
|
allocator.Deinit = NULL;
|
||||||
allocator.Init = NULL;
|
allocator.Malloc = mallocAllocatorMalloc;
|
||||||
allocator.Deinit = NULL;
|
allocator.Realloc = mallocAllocatorRealloc;
|
||||||
allocator.Malloc = mallocAllocatorMalloc;
|
allocator.Free = mallocAllocatorFree;
|
||||||
allocator.Realloc = mallocAllocatorRealloc;
|
|
||||||
allocator.Free = mallocAllocatorFree;
|
|
||||||
} /* if */
|
|
||||||
} /* setDefaultAllocator */
|
} /* setDefaultAllocator */
|
||||||
|
|
||||||
/* end of physfs.c ... */
|
/* end of physfs.c ... */
|
||||||
|
|
|
@ -655,20 +655,6 @@ int __PHYSFS_platformGrabMutex(void *mutex);
|
||||||
*/
|
*/
|
||||||
void __PHYSFS_platformReleaseMutex(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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -227,12 +227,6 @@ void __PHYSFS_platformReleaseMutex(void *mutex)
|
||||||
((BLocker *) mutex)->Unlock();
|
((BLocker *) mutex)->Unlock();
|
||||||
} /* __PHYSFS_platformReleaseMutex */
|
} /* __PHYSFS_platformReleaseMutex */
|
||||||
|
|
||||||
|
|
||||||
int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
|
|
||||||
{
|
|
||||||
return 0; /* just use malloc() and friends. */
|
|
||||||
} /* __PHYSFS_platformSetDefaultAllocator */
|
|
||||||
|
|
||||||
#endif /* PHYSFS_PLATFORM_BEOS */
|
#endif /* PHYSFS_PLATFORM_BEOS */
|
||||||
|
|
||||||
/* end of beos.cpp ... */
|
/* end of beos.cpp ... */
|
||||||
|
|
|
@ -212,12 +212,6 @@ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app)
|
||||||
return retval;
|
return retval;
|
||||||
} /* __PHYSFS_platformCalcPrefDir */
|
} /* __PHYSFS_platformCalcPrefDir */
|
||||||
|
|
||||||
|
|
||||||
int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
|
|
||||||
{
|
|
||||||
return 0; /* just use malloc() and friends. */
|
|
||||||
} /* __PHYSFS_platformSetDefaultAllocator */
|
|
||||||
|
|
||||||
#endif /* PHYSFS_PLATFORM_MACOSX */
|
#endif /* PHYSFS_PLATFORM_MACOSX */
|
||||||
|
|
||||||
/* end of macosx.c ... */
|
/* end of macosx.c ... */
|
||||||
|
|
|
@ -773,13 +773,6 @@ void __PHYSFS_platformReleaseMutex(void *mutex)
|
||||||
DosReleaseMutexSem((HMTX) mutex);
|
DosReleaseMutexSem((HMTX) mutex);
|
||||||
} /* __PHYSFS_platformReleaseMutex */
|
} /* __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 */
|
#endif /* PHYSFS_PLATFORM_OS2 */
|
||||||
|
|
||||||
/* end of os2.c ... */
|
/* end of os2.c ... */
|
||||||
|
|
|
@ -367,12 +367,6 @@ char *__PHYSFS_platformCalcPrefDir(const char *org, const char *app)
|
||||||
return retval;
|
return retval;
|
||||||
} /* __PHYSFS_platformCalcPrefDir */
|
} /* __PHYSFS_platformCalcPrefDir */
|
||||||
|
|
||||||
|
|
||||||
int __PHYSFS_platformSetDefaultAllocator(PHYSFS_Allocator *a)
|
|
||||||
{
|
|
||||||
return 0; /* just use malloc() and friends. */
|
|
||||||
} /* __PHYSFS_platformSetDefaultAllocator */
|
|
||||||
|
|
||||||
#endif /* PHYSFS_PLATFORM_UNIX */
|
#endif /* PHYSFS_PLATFORM_UNIX */
|
||||||
|
|
||||||
/* end of unix.c ... */
|
/* end of unix.c ... */
|
||||||
|
|
|
@ -945,13 +945,6 @@ int __PHYSFS_platformStat(const char *filename, PHYSFS_Stat *st)
|
||||||
return 1;
|
return 1;
|
||||||
} /* __PHYSFS_platformStat */
|
} /* __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_WINDOWS */
|
||||||
#endif /* PHYSFS_PLATFORM_WINRT */
|
#endif /* PHYSFS_PLATFORM_WINRT */
|
||||||
|
|
||||||
|
|
|
@ -665,12 +665,5 @@ int __PHYSFS_platformStat(const char *filename, PHYSFS_Stat *st)
|
||||||
return 1;
|
return 1;
|
||||||
} /* __PHYSFS_platformStat */
|
} /* __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_WINRT */
|
#endif /* PHYSFS_PLATFORM_WINRT */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue