Namespaces
Variants

std::pmr::polymorphic_allocator<T>:: deallocate_object

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)
template < class U >
void deallocate_object ( U * p, std:: size_t n = 1 ) ;
(C++20 이후)

p 가 가리키는 저장 공간을 해제합니다. 이 공간은 반드시 std::pmr::memory_resource x 로부터 할당되어야 하며, * resource ( ) 와 비교 시 동일해야 합니다. 해제는 x. allocate ( n * sizeof ( U ) , alignof ( U ) ) 를 사용하며, 일반적으로 allocate_object < U > ( n ) 호출을 통해 이루어집니다.

다음과 동일함: deallocate_bytes ( p, n * sizeof ( U ) , alignof ( U ) ) ; .

목차

매개변수

p - 할당 해제할 메모리를 가리키는 포인터
n - 메모리가 할당되었던 U 타입 객체의 개수

예외

아무것도 던지지 않습니다.

참고 사항

이 함수는 완전 특수화된 할당자 std:: pmr :: polymorphic_allocator <> 와 함께 사용하기 위해 도입되었으나, 모든 특수화에서 유용할 수 있습니다.

참고 항목

allocate_bytes 로부터 얻은 원시 메모리를 해제합니다
(public member function)
객체를 파괴하고 메모리를 해제합니다
(public member function)
[static]
할당자를 사용하여 저장 공간을 해제합니다
( std::allocator_traits<Alloc> 의 public static member function)
메모리를 해제합니다
( std::pmr::memory_resource 의 public member function)