Gtests, do we care about leaking memory on asserts?

Thomas Stüfe thomas.stuefe at gmail.com
Sat Sep 9 07:57:47 UTC 2017


Hi all,

I am writing a gtest which require memory to be allocated. What is the
policy about freeing it, do we care that we leak that memory on assert? So,
should I care to wrap an RAII object around it or similar?

Took a quick look at the current tests, there are a number of tests which
would leak C-Heap on assert, e.g:

memory/test_metachunk.cpp
memory/test_guardedMemory.cpp
gc/g1/test_freeRegionList.cpp

..

So, I guess this is fine?

Thank you, Thomas


More information about the hotspot-dev mailing list