google / tcmalloc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assertion in TCMallocInternalMallocSize

icuken opened this issue · comments

Looks like assertion in TCMallocInternalMallocSize is not exactly correct because according to man malloc_usable_size:

If ptr is NULL, 0 is returned.

But the following code crashes:

#include <malloc.h>

#include <iostream>

int main() {
        std::cout << malloc_usable_size(nullptr) << std::endl;

        return 0;
}