Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

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

      From cppreference.com
      <cpp‎ |memory‎ |polymorphic allocator
       
       
      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*)
      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));
      (since C++20)

      Deallocates the storage pointed to byp, which must have been allocated from astd::pmr::memory_resourcex that compares equal to*resource(), usingx.allocate(nbytes, alignment), typically through a call toallocate_bytes(nbytes, alignment).

      Equivalent toresource()->deallocate(p, nbytes, alignment);.

      Contents

      [edit]Parameters

      p - pointer to memory to deallocate
      nbytes - the number of bytes originally allocated
      alignment - the alignment originally allocated

      [edit]Exceptions

      Throws nothing.

      [edit]Notes

      This function was introduced for use with the fully-specialized allocatorstd::pmr::polymorphic_allocator<>, but it may be useful in any specialization.

      [edit]See also

      frees raw memory obtained byallocate_object
      (public member function)[edit]
      destroys and deallocates an object
      (public member function)[edit]
      [static]
      deallocates storage using the allocator
      (public static member function ofstd::allocator_traits<Alloc>)[edit]
      deallocates memory
      (public member function ofstd::pmr::memory_resource)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/memory/polymorphic_allocator/deallocate_bytes&oldid=155047"

      [8]ページ先頭

      ©2009-2025 Movatter.jp