Fix ALLOCM_ARENA(a) handling in rallocm().
Fix rallocm() to use the specified arena for allocation, not just deallocation. Clarify ALLOCM_ARENA(a) documentation.
This commit is contained in:
parent
d6df91438a
commit
39e7fd0580
@ -358,7 +358,7 @@ for (i = 0; i < nbins; i++) {
|
|||||||
<listitem><para>Initialize newly allocated memory to contain zero
|
<listitem><para>Initialize newly allocated memory to contain zero
|
||||||
bytes. In the growing reallocation case, the real size prior to
|
bytes. In the growing reallocation case, the real size prior to
|
||||||
reallocation defines the boundary between untouched bytes and those
|
reallocation defines the boundary between untouched bytes and those
|
||||||
that are initialized to contain zero bytes. If this option is
|
that are initialized to contain zero bytes. If this macro is
|
||||||
absent, newly allocated memory is uninitialized.</para></listitem>
|
absent, newly allocated memory is uninitialized.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
@ -373,9 +373,11 @@ for (i = 0; i < nbins; i++) {
|
|||||||
</constant></term>
|
</constant></term>
|
||||||
|
|
||||||
<listitem><para>Use the arena specified by the index
|
<listitem><para>Use the arena specified by the index
|
||||||
<parameter>a</parameter>. This macro does not validate that
|
<parameter>a</parameter> (and by necessity bypass the thread
|
||||||
<parameter>a</parameter> specifies an arena in the valid
|
cache). This macro has no effect for huge regions, nor for regions
|
||||||
range.</para></listitem>
|
that were allocated via an arena other than the one specified.
|
||||||
|
This macro does not validate that <parameter>a</parameter>
|
||||||
|
specifies an arena index in the valid range.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
|
@ -1530,7 +1530,7 @@ je_rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, int flags)
|
|||||||
|
|
||||||
if (arena_ind != UINT_MAX) {
|
if (arena_ind != UINT_MAX) {
|
||||||
arena_chunk_t *chunk;
|
arena_chunk_t *chunk;
|
||||||
try_tcache_alloc = true;
|
try_tcache_alloc = false;
|
||||||
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(*ptr);
|
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(*ptr);
|
||||||
try_tcache_dalloc = (chunk == *ptr || chunk->arena !=
|
try_tcache_dalloc = (chunk == *ptr || chunk->arena !=
|
||||||
arenas[arena_ind]);
|
arenas[arena_ind]);
|
||||||
|
Loading…
Reference in New Issue
Block a user