Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nice!

Why malloc? Surely this is an on-heap object, not malloc allocated?





I think you've got yourself confused. The heap is what malloc is allocating. So it's like you said "Surely this is somewhere in Europe, not France?" or "Surely this is a round shape, not a circle?"

Not when we’re talking about a JVM, which has its own heap that does not use malloc.

The JVM is of course just software. In this case it's mostly software written in C++ and that software allocates "its own heap" using uh... malloc

https://github.com/openjdk/jdk/blob/master/src/hotspot/share...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: