1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -219,6 +219,9 @@ public interface Arena extends SegmentAllocator, AutoCloseable {
219
219
* Segments allocated with the returned arena can be
220
220
* {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by any thread.
221
221
* 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.
222
225
*
223
226
* @return a new arena that is managed, automatically, by the garbage collector
224
227
*/
@@ -231,6 +234,9 @@ static Arena ofAuto() {
231
234
* {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by any thread.
232
235
* Calling {@link #close()} on the returned arena will result in
233
236
* an {@link UnsupportedOperationException}.
237
+ * <p>
238
+ * Memory segments {@linkplain #allocate(long, long) allocated} by the returned arena
239
+ * are zero-initialized.
234
240
*/
235
241
static Arena global () {
236
242
class Holder {
@@ -243,6 +249,9 @@ class Holder {
243
249
* {@return a new confined arena} Segments allocated with the confined arena can be
244
250
* {@linkplain MemorySegment#isAccessibleBy(Thread) accessed} by the thread
245
251
* 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.
246
255
*/
247
256
static Arena ofConfined () {
248
257
return MemorySessionImpl .createConfined (Thread .currentThread ()).asArena ();
@@ -251,6 +260,9 @@ static Arena ofConfined() {
251
260
/**
252
261
* {@return a new shared arena} Segments allocated with the global arena can be
253
262
* {@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.
254
266
*/
255
267
static Arena ofShared () {
256
268
return MemorySessionImpl .createShared ().asArena ();
0 commit comments