summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-05-09 16:33:57 +0000
committerNicholas Clark <nick@ccl4.org>2005-05-09 16:33:57 +0000
commit4977e971c94c012c59e3e99429a0cef3af185c4b (patch)
tree2fbfab0eca91f1d894d24d18fe08c61d143ce086
parent5c7983e52cf8e73d9330c0a5a2a9bfa6f0adf492 (diff)
downloadperl-4977e971c94c012c59e3e99429a0cef3af185c4b.tar.gz
Update the comment describing arenas.
p4raw-id: //depot/perl@24429
-rw-r--r--sv.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sv.c b/sv.c
index 386b30bedb..a20eae84e5 100644
--- a/sv.c
+++ b/sv.c
@@ -63,14 +63,13 @@ av, hv...) contains type and reference count information, as well as a
pointer to the body (struct xrv, xpv, xpviv...), which contains fields
specific to each type.
-Normally, this allocation is done using arenas, which are approximately
-1K chunks of memory parcelled up into N heads or bodies. The first slot
-in each arena is reserved, and is used to hold a link to the next arena.
-In the case of heads, the unused first slot also contains some flags and
-a note of the number of slots. Snaked through each arena chain is a
+Normally, this allocation is done using arenas, which by default are
+approximately 4K chunks of memory parcelled up into N heads or bodies. The
+first slot in each arena is reserved, and is used to hold a link to the next
+arena. In the case of heads, the unused first slot also contains some flags
+and a note of the number of slots. Snaked through each arena chain is a
linked list of free items; when this becomes empty, an extra arena is
-allocated and divided up into N items which are threaded into the free
-list.
+allocated and divided up into N items which are threaded into the free list.
The following global variables are associated with arenas:
@@ -86,7 +85,8 @@ are not allocated using arenas, but are instead just malloc()/free()ed as
required. Also, if PURIFY is defined, arenas are abandoned altogether,
with all items individually malloc()ed. In addition, a few SV heads are
not allocated from an arena, but are instead directly created as static
-or auto variables, eg PL_sv_undef.
+or auto variables, eg PL_sv_undef. The size of arenas can be changed from
+the default by setting PERL_ARENA_SIZE appropriately at compile time.
The SV arena serves the secondary purpose of allowing still-live SVs
to be located and destroyed during final cleanup.