@@ -37,10 +37,9 @@ struct Stack {
3737
3838 private:
3939 struct freeobj {
40- freeobj (memory_resource* mr, size_t s ) : resource(mr), size(s ) {}
40+ freeobj (memory_resource* mr) : resource(mr) {}
4141 memory_resource* resource{nullptr };
42- size_t size{0 };
43- void operator ()(std::byte* ptr) { resource->deallocate (ptr, size, alignof (std::max_align_t )); }
42+ void operator ()(std::byte* ptr) { resource->deallocate (ptr, 0 , alignof (std::max_align_t )); }
4443 };
4544
4645 public:
@@ -101,7 +100,7 @@ struct Stack {
101100 Stack (const allocator_type allocatorArg, Headers&&... headers)
102101 : allocator{allocatorArg},
103102 bufferSize{calculateSize (std::forward<Headers>(headers)...)},
104- buffer{static_cast <std::byte*>(allocator.resource ()->allocate (bufferSize, alignof (std::max_align_t ))), freeobj{allocator.resource (), bufferSize }}
103+ buffer{static_cast <std::byte*>(allocator.resource ()->allocate (bufferSize, alignof (std::max_align_t ))), freeobj{allocator.resource ()}}
105104 {
106105 if constexpr (sizeof ...(headers) > 1 ) {
107106 injectAll (buffer.get (), std::forward<Headers>(headers)...);
@@ -144,7 +143,7 @@ struct Stack {
144143 private:
145144 allocator_type allocator{std::pmr::new_delete_resource ()};
146145 size_t bufferSize{0 };
147- BufferType buffer{nullptr , freeobj{allocator.resource (), 0 }};
146+ BufferType buffer{nullptr , freeobj{allocator.resource ()}};
148147
149148 // ______________________________________________________________________________________________
150149 template <typename T>
0 commit comments