Disallow C-Heap allocations from within dynamic C++ initialization?

Florian Weimer fweimer at redhat.com
Tue Feb 23 15:20:30 UTC 2021


* Thomas Stüfe:

> The easiest approach would be to simply disallow early C-Heap allocations.
> So lets say I do this:
>
> - move (a part of) NMT initialization very close to the start of
> Thread::create_vm()
> - disallow and rewrite all code which does C-Heap allocation earlier
> (during dynamic C++ initialization)
>
> Would that be an acceptable and maintainable stance? Since that would mean
> that we disallow global C++ objects which do C-Heap allocation in their
> constructors somewhere.

What is a C-Heap allocation in this context?

With glibc, initializing a C++ object which has a non-trivial destructor
can call malloc.

Thanks,
Florian



More information about the hotspot-dev mailing list