RFR: 8301403: Eliminate memory allocations in JVMFlag::printFlags during signal handling [v3]
Gerard Ziemski
gziemski at openjdk.org
Fri Jul 19 20:25:32 UTC 2024
On Fri, 19 Jul 2024 19:40:23 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> > I would prefer not to use a solution using stack (I keep thinking of all the platforms that Java may run on, and some of them might not have as much stack room as modern desktop machines).
>
> We are talking about 187 bytes. That is 20ish stack words. If your stack pointer is that close to the guard page, you won't be able to do much anyway. You may even crash out in strcmp, since that involves at least one, probably multiple new invocation frames.
OK, suppose I'd like to use stack memory for this. According to "man alloca":
` alloca() is machine and compiler dependent; its use is discouraged.
`
I see usages of `alloca` in hotspot, but that note is bit worrying. Which API were you thinking of using?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20202#issuecomment-2240054033
More information about the hotspot-runtime-dev
mailing list