Autodetect unsafe allocations metadata for native images#2883
Autodetect unsafe allocations metadata for native images#2883riccardobl wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for detecting and configuring unsafe allocations in the JMonkeyEngine Native Image Gradle plugin. It adds an allowUnsafeAllocation property to the @PreserveReflection annotation, implements bytecode analysis to automatically detect constructions of unsafe allocation containers (such as SafeArrayList), and provides configuration options to explicitly define unsafe allocated types and container types. There are no review comments, so no additional feedback is provided.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
This extends the native image plugin to generate metadata for detected patterns of unsafe allocations in jme apps (currently only used by SafeArrayList in the engine) and to allow the dev to whitelist custom classes for this scope.
The bytecode parsing logic was made by gpt 5.5