11/*
2- * Copyright (c) 2022, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2022, 2024 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -219,6 +219,9 @@ public interface Arena extends SegmentAllocator, AutoCloseable {
219219 * Segments allocated with the returned arena can be
220220 * {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by any thread.
221221 * Calling {@link #close()} on the returned arena will result in an {@link UnsupportedOperationException}.
222+ * <p>
223+ * Memory segments {@linkplain #allocate(long, long) allocated} by the returned arena
224+ * are zero-initialized.
222225 *
223226 * @return a new arena that is managed, automatically, by the garbage collector
224227 */
@@ -231,6 +234,9 @@ static Arena ofAuto() {
231234 * {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by any thread.
232235 * Calling {@link #close()} on the returned arena will result in
233236 * an {@link UnsupportedOperationException}.
237+ * <p>
238+ * Memory segments {@linkplain #allocate(long, long) allocated} by the returned arena
239+ * are zero-initialized.
234240 */
235241 static Arena global () {
236242 class Holder {
@@ -243,6 +249,9 @@ class Holder {
243249 * {@return a new confined arena} Segments allocated with the confined arena can be
244250 * {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by the thread
245251 * that created the arena, the arena's <em>owner thread</em>.
252+ * <p>
253+ * Memory segments {@linkplain #allocate(long, long) allocated} by the returned arena
254+ * are zero-initialized.
246255 */
247256 static Arena ofConfined () {
248257 return MemorySessionImpl .createConfined (Thread .currentThread ()).asArena ();
@@ -251,6 +260,9 @@ static Arena ofConfined() {
251260 /**
252261 * {@return a new shared arena} Segments allocated with the global arena can be
253262 * {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by any thread.
263+ * <p>
264+ * Memory segments {@linkplain #allocate(long, long) allocated} by the returned arena
265+ * are zero-initialized.
254266 */
255267 static Arena ofShared () {
256268 return MemorySessionImpl .createShared ().asArena ();
0 commit comments