名前空間
変種

std::pmr::memory_resource::allocate

提供: cppreference.com
 
 
動的メモリ管理
スマートポインタ
(C++11)
(C++11)
(C++11)
(C++17未満)
(C++11)
アロケータ
メモリリソース
未初期化記憶域
ガベージコレクションサポート
その他
(C++20)
(C++11)
(C++11)
C のライブラリ
低水準のメモリ管理
 
 
<tbody> </tbody> <tbody class="t-dcl-rev "> </tbody><tbody> </tbody>
void* allocate(std::size_t bytes, std::size_t alignment = alignof(std::max_align_t));
(C++17以上)
(C++20未満)
[[nodiscard]] void* allocate(std::size_t bytes, std::size_t alignment = alignof(std::max_align_t));
(C++20以上)

少なくとも bytes バイトのサイズを持つ記憶域を確保します。 返された記憶域は、そのようなアライメントがサポートされていれば指定された alignment に、そうでなければ alignof(std::max_align_t) にアラインされます。

return do_allocate(bytes, alignment); と同等です。

例外

要求されたサイズおよびアライメントの記憶域が取得できない場合は例外を投げます。

関連項目

[仮想]
メモリを確保します
(仮想プライベートメンバ関数) [edit]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.