Skip to content

Commit

Permalink
Fix wrong FindFirstBitNonZero in GL_HeapSmallAllocateFromBlock
Browse files Browse the repository at this point in the history
Mask is 64 bit wide
  • Loading branch information
Novum committed Jan 6, 2025
1 parent 50f53ec commit 3761997
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Quake/gl_heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ static void GL_HeapSmallAllocateFromBlock (
GL_HeapAddPageToSmallFreeList (segment, block_page_index, small_alloc_bucket);
}

const uint32_t slot_index = FindFirstBitNonZero (~(*small_alloc_mask));
const uint32_t slot_index = FindFirstBitNonZero64 (~(*small_alloc_mask));
TRACE_LOG (" Allocated slot %d from page %u (mask %" PRIx64 ")\n", slot_index, block_page_index, *small_alloc_mask);
*small_alloc_mask |= 1ull << slot_index;

Expand Down

0 comments on commit 3761997

Please sign in to comment.