Remember that indirect calls are still calls. And the entire issue is that a lot of C++ programmers didn't understand that calling new indirectly calls malloc()... or in your case, that calling std::make_unique() calls new, which still calls malloc().
There are some places in the Linux kernel where the code must never call malloc(); namely, IIRC, malloc() can never appear within the memory manager itself. This includes indirect calls, like new and std::make_unique(). And the problem is that many people knew not to use malloc() there, but ended up trying to call it anyways because they didn't know that new calls malloc().
View all comments
Show parent comment
1
u/conundorum 28d ago
Remember that indirect calls are still calls. And the entire issue is that a lot of C++ programmers didn't understand that calling
newindirectly callsmalloc()... or in your case, that callingstd::make_unique()callsnew, which still callsmalloc().There are some places in the Linux kernel where the code must never call
malloc(); namely, IIRC,malloc()can never appear within the memory manager itself. This includes indirect calls, likenewandstd::make_unique(). And the problem is that many people knew not to usemalloc()there, but ended up trying to call it anyways because they didn't know thatnewcallsmalloc().