From 09a3d25ccffec00ca9bbcd30fe0459b223670702 Mon Sep 17 00:00:00 2001 From: Alexandru Jercaianu Date: Wed, 29 Nov 2017 16:02:31 +0200 Subject: [PATCH] replace deallocate with deallocateAll test --- .../allocator/building_blocks/allocator_list.d | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/std/experimental/allocator/building_blocks/allocator_list.d b/std/experimental/allocator/building_blocks/allocator_list.d index 3c8cf8183..a040db850 100644 --- a/std/experimental/allocator/building_blocks/allocator_list.d +++ b/std/experimental/allocator/building_blocks/allocator_list.d @@ -476,17 +476,18 @@ struct AllocatorList(Factory, BookkeepingAllocator = GCAllocator) assert(special || !allocators.ptr); if (special) { - static if (stateSize!Allocator) + static if (stateSize!SAllocator) { import core.stdc.string : memcpy; - Allocator specialCopy; - memcpy(&specialCopy, &special.a, Allocator.sizeof); + SAllocator specialCopy; + assert(special.a.sizeof == specialCopy.sizeof); + memcpy(&specialCopy, &special.a, specialCopy.sizeof); emplace(&special.a); - specialCopy.deallocate(allocators); + specialCopy.deallocateAll(); } else { - special.deallocate(allocators); + special.deallocateAll(); } } allocators = null;