File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
std/experimental/allocator Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,18 @@ module std.experimental.allocator;
226226public import std.experimental.allocator.common ,
227227 std.experimental.allocator.typed ;
228228
229+ // Fix issue 17806: this should always be the first unittest in this module
230+ // in order to ensure that we use the `processAllocator` setter before the getter
231+ @system unittest
232+ {
233+ import std.experimental.allocator.mallocator : Mallocator;
234+ import std.experimental.allocator.gc_allocator : GCAllocator;
235+ auto newAlloc = sharedAllocatorObject(Mallocator.instance);
236+ processAllocator = newAlloc;
237+ assert (processAllocator is newAlloc);
238+ processAllocator = sharedAllocatorObject(GCAllocator.instance);
239+ }
240+
229241// Example in the synopsis above
230242@system unittest
231243{
@@ -1058,10 +1070,10 @@ allocator can be cast to `shared`.
10581070
10591071// / Ditto
10601072@nogc nothrow @system
1061- @property void processAllocator(RCISharedAllocator a)
1073+ @property void processAllocator(ref RCISharedAllocator a)
10621074{
10631075 assert (! a.isNull);
1064- _processAllocator = a;
1076+ processAllocator() = a;
10651077}
10661078
10671079@system unittest
You can’t perform that action at this time.
0 commit comments