RFR: 8352536: Add overloads to parse and build class files from/to MemorySegment [v5]

Chen Liang liach at openjdk.org
Fri Mar 28 23:31:41 UTC 2025


On Thu, 27 Mar 2025 17:38:49 GMT, David M. Lloyd <duke at openjdk.org> wrote:

>> Provide method overloads to the ClassFile interface of the java.lang.classfile API which allow parsing of classes found in memory segments, as well as allowing built class files to be output to them.
>
> David M. Lloyd has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add a benchmark for class file emission

If we want to reduce allocation at writing time, we may well look at the new allocation facility from #24232; that is a general-utility tool to reduce allocation pressure for large byte arrays, especially if an actual `byte[]` view is not strictly required. BufWriter and the allocation-free copying of data to a memory segment may benefit.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24139#issuecomment-2762844063


More information about the core-libs-dev mailing list