| ... | @@ -732,6 +732,7 @@ pub fn GeneralPurposeAllocator(comptime config: Config) type { | ... | @@ -732,6 +732,7 @@ pub fn GeneralPurposeAllocator(comptime config: Config) type { |
| 732 | if (!self.large_allocations.contains(@intFromPtr(old_mem.ptr))) { | 732 | if (!self.large_allocations.contains(@intFromPtr(old_mem.ptr))) { |
| 733 | // object not in active buckets or a large allocation, so search empty buckets | 733 | // object not in active buckets or a large allocation, so search empty buckets |
| 734 | if (searchBucket(&self.empty_buckets, @intFromPtr(old_mem.ptr), null)) |bucket| { | 734 | if (searchBucket(&self.empty_buckets, @intFromPtr(old_mem.ptr), null)) |bucket| { |
| | 735 | size_class = bucket.emptyBucketSizeClass(); |
| 735 | // bucket is empty so is_used below will always be false and we exit there | 736 | // bucket is empty so is_used below will always be false and we exit there |
| 736 | break :blk bucket; | 737 | break :blk bucket; |
| 737 | } else { | 738 | } else { |
| ... | @@ -850,6 +851,7 @@ pub fn GeneralPurposeAllocator(comptime config: Config) type { | ... | @@ -850,6 +851,7 @@ pub fn GeneralPurposeAllocator(comptime config: Config) type { |
| 850 | if (!self.large_allocations.contains(@intFromPtr(old_mem.ptr))) { | 851 | if (!self.large_allocations.contains(@intFromPtr(old_mem.ptr))) { |
| 851 | // object not in active buckets or a large allocation, so search empty buckets | 852 | // object not in active buckets or a large allocation, so search empty buckets |
| 852 | if (searchBucket(&self.empty_buckets, @intFromPtr(old_mem.ptr), null)) |bucket| { | 853 | if (searchBucket(&self.empty_buckets, @intFromPtr(old_mem.ptr), null)) |bucket| { |
| | 854 | size_class = bucket.emptyBucketSizeClass(); |
| 853 | // bucket is empty so is_used below will always be false and we exit there | 855 | // bucket is empty so is_used below will always be false and we exit there |
| 854 | break :blk bucket; | 856 | break :blk bucket; |
| 855 | } else { | 857 | } else { |