From 0f04bb1d6fc27c7fa5f6268d045c78bdc600ff65 Mon Sep 17 00:00:00 2001
From: Jason Evans <jasone@canonware.com>
Date: Tue, 3 Jan 2017 08:21:29 -0800
Subject: Rename the arenas.extend mallctl to arenas.create.

---
 doc/jemalloc.xml.in               | 18 +++++++++---------
 include/jemalloc/internal/arena.h |  6 +++---
 src/ctl.c                         |  6 +++---
 src/jemalloc.c                    |  2 +-
 test/integration/MALLOCX_ARENA.c  |  4 ++--
 test/integration/extent.c         |  4 ++--
 test/integration/xallocx.c        |  2 +-
 test/unit/arena_reset.c           |  2 +-
 test/unit/mallctl.c               |  6 +++---
 test/unit/pack.c                  |  8 ++++----
 10 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in
index f6b5062..36aae37 100644
--- a/doc/jemalloc.xml.in
+++ b/doc/jemalloc.xml.in
@@ -1457,8 +1457,8 @@ malloc_conf = "xmalloc:true";]]></programlisting>
           <literal>--</literal>
         </term>
         <listitem><para>Discard all of the arena's extant allocations.  This
-        interface can only be used with arenas created via <link
-        linkend="arenas.extend"><mallctl>arenas.extend</mallctl></link>.  None
+        interface can only be used with arenas explicitly created via <link
+        linkend="arenas.create"><mallctl>arenas.create</mallctl></link>.  None
         of the arena's discarded/cached allocations may accessed afterward.  As
         part of this requirement, all thread caches which were used to
         allocate/deallocate in conjunction with the arena must be flushed
@@ -1504,8 +1504,8 @@ malloc_conf = "xmalloc:true";]]></programlisting>
         arena &lt;i&gt;.  The functions must be capable of operating on all
         extant extents associated with arena &lt;i&gt;, usually by passing
         unknown extents to the replaced functions.  In practice, it is feasible
-        to control allocation for arenas created via <link
-        linkend="arenas.extend"><mallctl>arenas.extend</mallctl></link> such
+        to control allocation for arenas explicitly created via <link
+        linkend="arenas.create"><mallctl>arenas.create</mallctl></link> such
         that all extents originate from an application-supplied extent allocator
         (by specifying the custom extent hook functions during arena creation),
         but the automatically created arenas will have already created extents
@@ -1836,15 +1836,15 @@ struct extent_hooks_s {
         class.</para></listitem>
       </varlistentry>
 
-      <varlistentry id="arenas.extend">
+      <varlistentry id="arenas.create">
         <term>
-          <mallctl>arenas.extend</mallctl>
+          <mallctl>arenas.create</mallctl>
           (<type>unsigned</type>, <type>extent_hooks_t *</type>)
           <literal>rw</literal>
         </term>
-        <listitem><para>Extend the array of arenas by appending a new arena with
-        optionally specified extent hooks, and returning the new arena
-        index.</para></listitem>
+        <listitem><para>Explicitly create a new arena outside the range of
+        automatically managed arenas, with optionally specified extent hooks,
+        and return the new arena index.</para></listitem>
       </varlistentry>
 
       <varlistentry id="prof.thread_active_init">
diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h
index d889852..929adbe 100644
--- a/include/jemalloc/internal/arena.h
+++ b/include/jemalloc/internal/arena.h
@@ -148,9 +148,9 @@ struct arena_s {
 	 * atomic operations.  Each thread has two distinct assignments, one for
 	 * application-serving allocation, and the other for internal metadata
 	 * allocation.  Internal metadata must not be allocated from arenas
-	 * created via the arenas.extend mallctl, because the arena.<i>.reset
-	 * mallctl indiscriminately discards all allocations for the affected
-	 * arena.
+	 * explicitly created via the arenas.create mallctl, because the
+	 * arena.<i>.reset mallctl indiscriminately discards all allocations for
+	 * the affected arena.
 	 *
 	 *   0: Application allocation.
 	 *   1: Internal metadata allocation.
diff --git a/src/ctl.c b/src/ctl.c
index 4e5511e..872da80 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -133,7 +133,7 @@ CTL_PROTO(arenas_tcache_max)
 CTL_PROTO(arenas_nbins)
 CTL_PROTO(arenas_nhbins)
 CTL_PROTO(arenas_nlextents)
-CTL_PROTO(arenas_extend)
+CTL_PROTO(arenas_create)
 CTL_PROTO(prof_thread_active_init)
 CTL_PROTO(prof_active)
 CTL_PROTO(prof_dump)
@@ -323,7 +323,7 @@ static const ctl_named_node_t arenas_node[] = {
 	{NAME("bin"),		CHILD(indexed, arenas_bin)},
 	{NAME("nlextents"),	CTL(arenas_nlextents)},
 	{NAME("lextent"),	CHILD(indexed, arenas_lextent)},
-	{NAME("extend"),	CTL(arenas_extend)}
+	{NAME("create"),	CTL(arenas_create)}
 };
 
 static const ctl_named_node_t	prof_node[] = {
@@ -1780,7 +1780,7 @@ arenas_lextent_i_index(tsdn_t *tsdn, const size_t *mib, size_t miblen, size_t i)
 }
 
 static int
-arenas_extend_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
+arenas_create_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
     size_t *oldlenp, void *newp, size_t newlen)
 {
 	int ret;
diff --git a/src/jemalloc.c b/src/jemalloc.c
index 2c49401..2acab41 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -533,7 +533,7 @@ arena_tdata_get_hard(tsd_t *tsd, unsigned ind)
 	 * Copy to tdata array.  It's possible that the actual number of arenas
 	 * has increased since narenas_total_get() was called above, but that
 	 * causes no correctness issues unless two threads concurrently execute
-	 * the arenas.extend mallctl, which we trust mallctl synchronization to
+	 * the arenas.create mallctl, which we trust mallctl synchronization to
 	 * prevent.
 	 */
 
diff --git a/test/integration/MALLOCX_ARENA.c b/test/integration/MALLOCX_ARENA.c
index 910a096..58032da 100644
--- a/test/integration/MALLOCX_ARENA.c
+++ b/test/integration/MALLOCX_ARENA.c
@@ -19,8 +19,8 @@ thd_start(void *arg)
 	size_t sz;
 
 	sz = sizeof(arena_ind);
-	assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0),
-	    0, "Error in arenas.extend");
+	assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0),
+	    0, "Error in arenas.create");
 
 	if (thread_ind % 4 != 3) {
 		size_t mib[3];
diff --git a/test/integration/extent.c b/test/integration/extent.c
index e2bd005..6be3b83 100644
--- a/test/integration/extent.c
+++ b/test/integration/extent.c
@@ -292,7 +292,7 @@ TEST_BEGIN(test_extent_manual_hook)
 	size_t hooks_miblen;
 
 	sz = sizeof(unsigned);
-	assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0),
+	assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0),
 	    0, "Unexpected mallctl() failure");
 
 	/* Install custom extent hooks. */
@@ -354,7 +354,7 @@ TEST_BEGIN(test_extent_auto_hook)
 
 	sz = sizeof(unsigned);
 	new_size = sizeof(extent_hooks_t *);
-	assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz,
+	assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz,
 	    (void *)&new_hooks, new_size), 0, "Unexpected mallctl() failure");
 
 	test_extent_body(arena_ind);
diff --git a/test/integration/xallocx.c b/test/integration/xallocx.c
index f608372..d35ca39 100644
--- a/test/integration/xallocx.c
+++ b/test/integration/xallocx.c
@@ -16,7 +16,7 @@ arena_ind(void)
 
 	if (ind == 0) {
 		size_t sz = sizeof(ind);
-		assert_d_eq(mallctl("arenas.extend", (void *)&ind, &sz, NULL,
+		assert_d_eq(mallctl("arenas.create", (void *)&ind, &sz, NULL,
 		    0), 0, "Unexpected mallctl failure creating arena");
 	}
 
diff --git a/test/unit/arena_reset.c b/test/unit/arena_reset.c
index 6c944b2..3a1b30f 100644
--- a/test/unit/arena_reset.c
+++ b/test/unit/arena_reset.c
@@ -90,7 +90,7 @@ TEST_BEGIN(test_arena_reset)
 	tsdn_t *tsdn;
 
 	sz = sizeof(unsigned);
-	assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0),
+	assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0),
 	    0, "Unexpected mallctl() failure");
 
 	flags = MALLOCX_ARENA(arena_ind) | MALLOCX_TCACHE_NONE;
diff --git a/test/unit/mallctl.c b/test/unit/mallctl.c
index e0efdce..95c2775 100644
--- a/test/unit/mallctl.c
+++ b/test/unit/mallctl.c
@@ -584,14 +584,14 @@ TEST_BEGIN(test_arenas_lextent_constants)
 }
 TEST_END
 
-TEST_BEGIN(test_arenas_extend)
+TEST_BEGIN(test_arenas_create)
 {
 	unsigned narenas_before, arena, narenas_after;
 	size_t sz = sizeof(unsigned);
 
 	assert_d_eq(mallctl("arenas.narenas", (void *)&narenas_before, &sz,
 	    NULL, 0), 0, "Unexpected mallctl() failure");
-	assert_d_eq(mallctl("arenas.extend", (void *)&arena, &sz, NULL, 0), 0,
+	assert_d_eq(mallctl("arenas.create", (void *)&arena, &sz, NULL, 0), 0,
 	    "Unexpected mallctl() failure");
 	assert_d_eq(mallctl("arenas.narenas", (void *)&narenas_after, &sz, NULL,
 	    0), 0, "Unexpected mallctl() failure");
@@ -647,6 +647,6 @@ main(void)
 	    test_arenas_constants,
 	    test_arenas_bin_constants,
 	    test_arenas_lextent_constants,
-	    test_arenas_extend,
+	    test_arenas_create,
 	    test_stats_arenas));
 }
diff --git a/test/unit/pack.c b/test/unit/pack.c
index 10df08e..81ded4e 100644
--- a/test/unit/pack.c
+++ b/test/unit/pack.c
@@ -68,14 +68,14 @@ nregs_per_run_compute(void)
 }
 
 static unsigned
-arenas_extend_mallctl(void)
+arenas_create_mallctl(void)
 {
 	unsigned arena_ind;
 	size_t sz;
 
 	sz = sizeof(arena_ind);
-	assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0),
-	    0, "Error in arenas.extend");
+	assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0),
+	    0, "Error in arenas.create");
 
 	return (arena_ind);
 }
@@ -95,7 +95,7 @@ arena_reset_mallctl(unsigned arena_ind)
 
 TEST_BEGIN(test_pack)
 {
-	unsigned arena_ind = arenas_extend_mallctl();
+	unsigned arena_ind = arenas_create_mallctl();
 	size_t nregs_per_run = nregs_per_run_compute();
 	size_t nregs = nregs_per_run * NSLABS;
 	VARIABLE_ARRAY(void *, ptrs, nregs);
-- 
cgit v0.12