"Typo" in mallocn_lockfree_impl.c
Closed, ResolvedPublic

Description

In 2.79 and in my (not updated) 2.8, in the function "MEM_lockfree_reallocN_id", I think "MEM_lockfree_mallocN_aligned" in the code below should use 'len' and not 'old_len'.

... but is there some tricky thing here or something I don't understand?

		MemHead *memh = MEMHEAD_FROM_PTR(vmemh);
		size_t old_len = MEM_allocN_len(vmemh);

		if (LIKELY(!MEMHEAD_IS_ALIGNED(memh))) {
			newp = MEM_lockfree_mallocN(len, "realloc");
		}
		else {
			MemHeadAligned *memh_aligned = MEMHEAD_ALIGNED_FROM_PTR(vmemh);
			newp = MEM_lockfree_mallocN_aligned(
				old_len,  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<See here (line 207)
				(size_t)memh_aligned->alignment,
				"realloc");
		}

Details

Type
Bug