英語版
このページの英語版を見る
std.experimental.allocator.gc_allocator
Dの組み込みガベージコレクション・アロケータ。
- struct
GCAllocator; - Dの組み込みガベージコレクション・アロケータ。Examples:
auto buffer = GCAllocator.instance.allocate(1024 * 1024 * 4); // deallocate upon scope's end (alternatively: leave it to collection) scope(exit) GCAllocator.instance.deallocate(buffer); //...
- enum uint
alignment; - アラインメントはplatformAlignment に等しい静的定数である。 に等しい静的定数であり、どのDデータ型に対しても適切なアライメントを保証する。
- shared const pure nothrow @trusted void[]
allocate(size_tbytes);
shared const pure nothrow @trusted boolexpand(ref void[]b, size_tdelta);
shared const pure nothrow @system boolreallocate(ref void[]b, size_tnewSize);
shared const pure nothrow @nogc @trusted TernaryresolveInternalPointer(const void*p, ref void[]result);
shared const pure nothrow @nogc @system booldeallocate(void[]b);
shared const pure nothrow @nogc @safe size_tgoodAllocSize(size_tn); - 標準的なアロケータ・メソッドは、上で定義されたセマンティクスに従う。 deallocate と
reallocateメソッドは@system である。 メソッドは、ユーザー・コードにダングリング・ポインターを残してメモリを移動する可能性があるため、。 - static shared const GCAllocator
instance; - このアロケータ型のグローバル・インスタンスを返す。ガベージコレクションされた アロケータはスレッドセーフなので、すべてのメソッドと
instanceそれ自身 はshared である。
Copyright © 1999-2025 by the D Language Foundation
DEEPL APIにより翻訳、ところどころ修正。
このページの最新版(英語)
このページの原文(英語)
翻訳時のdmdのバージョン: 2.108.0
サイト全体のドキュメントのdmdのバージョン: 2.109.1
最新のdmdのバージョン: 2.111.0 ダウンロード
翻訳日付:
HTML生成日時:
編集者: dokutoku