Namespaces
Variants

std::pmr::polymorphic_allocator<T>:: deallocate_bytes

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
void deallocate_bytes ( void * p,

std:: size_t nbytes,

std:: size_t alignment = alignof ( std:: max_align_t ) ) ;
(C++20以降)

p が指すストレージを解放します。このストレージは、 std::pmr::memory_resource x から割り当てられたものでなければならず、かつ * resource ( ) と等価であることが比較されなければなりません。解放は x. allocate ( nbytes, alignment ) を使用して行われ、通常は allocate_bytes ( nbytes, alignment ) の呼び出しを通じて行われます。

resource ( ) - > deallocate ( p, nbytes, alignment ) ; に相当します。

目次

パラメータ

p - 解放するメモリへのポインタ
nbytes - 元々割り当てられたバイト数
alignment - 元々割り当てられたアライメント

例外

例外を送出しません。

注記

この関数は完全特殊化アロケータ std:: pmr :: polymorphic_allocator <> で使用するために導入されましたが、あらゆる特殊化で有用である可能性があります。

関連項目

allocate_object で取得した生メモリを解放する
(公開メンバ関数)
オブジェクトを破棄して割り当てを解除する
(公開メンバ関数)
[static]
アロケータを使用してストレージを割り当て解除する
( std::allocator_traits<Alloc> の公開静的メンバ関数)
メモリを割り当て解除する
( std::pmr::memory_resource の公開メンバ関数)