Skip to content

Commit

Permalink
corrections to allocAppendable() for finalizer handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsm9000 committed Aug 30, 2023
1 parent 411f3ae commit 6a4dff2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdlib/d/gc/tcache.d
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ public:

void* allocAppendable(size_t size, bool containsPointers,
bool finalizable = false) {
auto alignment = finalizable ? 32 : 2 * Quantum;
auto asize = alignUp(size, alignment);
auto asize = finalizable
? alignUp(size + PointerSize, 32)
: alignUp(size, 2 * Quantum);
assert(isAppendableSizeClass(getSizeClass(asize)),
"allocAppendable got non-appendable size class!");
auto ptr = alloc(asize, containsPointers);
Expand Down

0 comments on commit 6a4dff2

Please sign in to comment.