|
|
|
|
|
by lgg
877 days ago
|
|
There is a bug here... Clearly the author intended to cache the value of nextmalloc to avoid calling dlsym() on every malloc. The correct code should be: static void *(*nextmalloc)(size_t) = NULL;
if (!nextmalloc)
nextmalloc = dlsym(RTLD_NEXT, "malloc");
}
Somehow the fact that the optimization is incorrectly missed here feels appropriate ;-) |
|
the other bug of course is that it's not thread safe