Replace defaultAllocator with theAllocator

This commit is contained in:
2016-11-30 21:54:31 +01:00
parent ed0eb4ac74
commit 9fdcef86e7
8 changed files with 106 additions and 117 deletions

View File

@ -14,13 +14,8 @@ import std.experimental.allocator;
import std.traits;
import std.typecons : Ternary;
version (unittest)
{
import tanya.memory : defaultAllocator;
}
/**
* Allocator interface.
* Abstract class implementing a basic allocator.
*/
abstract class Allocator : IAllocator
{
@ -170,16 +165,16 @@ unittest
{
int[] p;
defaultAllocator.resizeArray(p, 20);
theAllocator.resizeArray(p, 20);
assert(p.length == 20);
defaultAllocator.resizeArray(p, 30);
theAllocator.resizeArray(p, 30);
assert(p.length == 30);
defaultAllocator.resizeArray(p, 10);
theAllocator.resizeArray(p, 10);
assert(p.length == 10);
defaultAllocator.resizeArray(p, 0);
theAllocator.resizeArray(p, 0);
assert(p is null);
}

View File

@ -12,8 +12,3 @@ module tanya.memory;
public import tanya.memory.allocator;
public import std.experimental.allocator;
@property IAllocator defaultAllocator()
{
return theAllocator;
}