英語版
このページの英語版を見る

std.experimental.allocator.building_blocks.null_allocator

struct NullAllocator;
NullAllocatorはアロケータ インターフェースの実装である。直接の使い道はないが、複合アロケーターの「ターミネーター」として役に立つ。 複合アロケータでは「ターミネータ」として役に立つ。
enum uint alignment;
NullAllocator は64KBという比較的大きなアライメントを宣伝している。 これは、 。 を使う複合アロケータは不必要に制約されるべきではないからだ。 を使用する複合アロケータが不必要に制約されるべきではないからである。NullAllocator NullAllocator
shared pure nothrow @nogc @safe void[] allocate(size_t);
常にnull を返す。
shared pure nothrow @nogc @safe void[] alignedAllocate(size_t, uint);
常にnull を返す。
shared pure nothrow @nogc @safe void[] allocateAll();
常にnull を返す。
shared pure nothrow @nogc @safe bool expand(ref void[] b, size_t s);

shared pure nothrow @nogc @safe bool reallocate(ref void[] b, size_t);

shared pure nothrow @nogc @safe bool alignedReallocate(ref void[] b, size_t, uint);
これらのメソッドはfalse を返す。

前提条件 b is null.これは、他に正当な入力がないからである。 正当な入力がないからである。

shared const pure nothrow @nogc @safe Ternary owns(const void[]);
Ternary.no を返す。
shared const pure nothrow @nogc @safe Ternary resolveInternalPointer(const void*, ref void[]);
Ternary.no を返す。
shared pure nothrow @nogc @safe bool deallocate(void[] b);
ノーオペ。

前提条件 b is null

shared pure nothrow @nogc @safe bool deallocateAll();
ノーオープン。
shared const pure nothrow @nogc @safe Ternary empty();
Ternary.yes を返す。
static shared NullAllocator instance;
NullAllocatorshared グローバルインスタンスを返す。