From a1271af5df92bf8db9d1b3017c65e16590147dce Mon Sep 17 00:00:00 2001 From: Boshen Date: Mon, 29 Jan 2024 21:34:45 +0800 Subject: [PATCH] docs(allocator): document behaviour of `Box` --- crates/oxc_allocator/src/arena.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/oxc_allocator/src/arena.rs b/crates/oxc_allocator/src/arena.rs index 74ee4c1a7..4d6cd6c96 100644 --- a/crates/oxc_allocator/src/arena.rs +++ b/crates/oxc_allocator/src/arena.rs @@ -14,7 +14,9 @@ use serde::{ser::SerializeSeq, Serialize, Serializer}; use crate::Allocator; -/// Bumpalo Box +/// A Box without Drop. +/// This is used for over coming self-referential structs. +/// It is a memory leak if the boxed value has a `Drop` implementation. pub struct Box<'alloc, T: ?Sized>(pub &'alloc mut T); impl<'alloc, T> Box<'alloc, T> {