We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2b2243 commit 7fe48c5Copy full SHA for 7fe48c5
libc/src/__support/GPU/allocator.cpp
@@ -433,13 +433,15 @@ static Slab *find_slab(uint32_t chunk_size) {
433
lane_mask, cpp::countr_zero(available & uniform), candidate);
434
435
// Each uniform group will use the first empty slot they find.
436
- if (offset >= ARRAY_SIZE ||
437
- (index == cpp::numeric_limits<uint32_t>::max() &&
+ if ((index == cpp::numeric_limits<uint32_t>::max() &&
438
(available & uniform)))
439
index = new_index;
440
441
- if (offset >= ARRAY_SIZE)
+ // Guaruntees that this loop will eventuall exit if there is no space.
+ if (offset >= ARRAY_SIZE) {
442
result = reinterpret_cast<Slab *>(SENTINEL);
443
+ index = 0;
444
+ }
445
}
446
447
// Try to claim a slot for the found slot.
0 commit comments