Skip to content

Commit

Permalink
Do not deallocate on realloc when size is not 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
deadalnix committed Aug 23, 2023
1 parent 62fb41a commit f94baa8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sdlib/d/gc/tcache.d
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ public:
}

void* realloc(void* ptr, size_t size, bool containsPointers) {
if (!isAllocatableSize(size)) {
if (size == 0) {
free(ptr);
}

if (!isAllocatableSize(size)) {
return null;
}

Expand Down

0 comments on commit f94baa8

Please sign in to comment.