Created
April 3, 2018 14:44
-
-
Save run-dlang/29aff7add7c27d58dd005aa76073a4fe to your computer and use it in GitHub Desktop.
Code shared from run.dlang.io.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() | |
{ | |
import std.experimental.allocator; | |
import std.experimental.allocator.mallocator: Mallocator; | |
import std.experimental.allocator.gc_allocator : GCAllocator; | |
auto newAlloc = sharedAllocatorObject(Mallocator.instance); | |
processAllocator() = newAlloc; | |
assert(processAllocator is newAlloc); | |
processAllocator = sharedAllocatorObject(GCAllocator.instance); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment