mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-15 21:27:18 +03:00
Remove extra argument for malloc_tsd_cleanup_register
Bookkeeping an extra argument that actually only stores a function pointer for a function we already have is not very useful.
This commit is contained in:
parent
8ad483fe60
commit
13067ec835
2 changed files with 8 additions and 14 deletions
|
|
@ -46,7 +46,7 @@ _malloc_thread_cleanup(void)
|
|||
again = false;
|
||||
for (i = 0; i < ncleanups; i++) {
|
||||
if (pending[i]) {
|
||||
pending[i] = cleanups[i].f(cleanups[i].arg);
|
||||
pending[i] = cleanups[i]();
|
||||
if (pending[i])
|
||||
again = true;
|
||||
}
|
||||
|
|
@ -56,12 +56,11 @@ _malloc_thread_cleanup(void)
|
|||
#endif
|
||||
|
||||
void
|
||||
malloc_tsd_cleanup_register(bool (*f)(void *), void *arg)
|
||||
malloc_tsd_cleanup_register(bool (*f)(void))
|
||||
{
|
||||
|
||||
assert(ncleanups < MALLOC_TSD_CLEANUPS_MAX);
|
||||
cleanups[ncleanups].f = f;
|
||||
cleanups[ncleanups].arg = arg;
|
||||
cleanups[ncleanups] = f;
|
||||
ncleanups++;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue