Skip to content

Commit 1c35f63

Browse files
committed
Guard tsdn_tsd() call with tsdn_null() check.
1 parent 0fc1317 commit 1c35f63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/huge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ huge_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment,
6767
assert(ausize >= chunksize);
6868

6969
/* Allocate an extent node with which to track the chunk. */
70-
assert(tsdn != NULL || arena != NULL);
7170
node = ipallocztm(tsdn, CACHELINE_CEILING(sizeof(extent_node_t)),
7271
CACHELINE, false, NULL, true, arena_ichoose(tsdn, arena));
7372
if (node == NULL)
@@ -78,7 +77,8 @@ huge_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment,
7877
* it is possible to make correct junk/zero fill decisions below.
7978
*/
8079
is_zeroed = zero;
81-
arena = arena_choose(tsdn_tsd(tsdn), arena);
80+
if (likely(!tsdn_null(tsdn)))
81+
arena = arena_choose(tsdn_tsd(tsdn), arena);
8282
if (unlikely(arena == NULL) || (ret = arena_chunk_alloc_huge(tsdn,
8383
arena, usize, alignment, &is_zeroed)) == NULL) {
8484
idalloctm(tsdn, node, NULL, true, true);

0 commit comments

Comments
 (0)