| 158 | } |
| 159 | |
| 160 | void* unsynchronized_pool_resource::__adhoc_pool::__do_allocate(memory_resource* upstream, size_t bytes, size_t align) { |
| 161 | const size_t footer_size = sizeof(__chunk_footer); |
| 162 | const size_t footer_align = alignof(__chunk_footer); |
| 163 | |
| 164 | if (align < footer_align) |
| 165 | align = footer_align; |
| 166 | |
| 167 | size_t aligned_capacity = roundup(bytes, footer_align) + footer_size; |
| 168 | |
| 169 | void* result = upstream->allocate(aligned_capacity, align); |
| 170 | |
| 171 | __chunk_footer* h = (__chunk_footer*)((char*)result + aligned_capacity - footer_size); |
| 172 | h->__next_ = __first_; |
| 173 | h->__start_ = (char*)result; |
| 174 | h->__align_ = align; |
| 175 | __first_ = h; |
| 176 | return result; |
| 177 | } |
| 178 | |
| 179 | void unsynchronized_pool_resource::__adhoc_pool::__do_deallocate( |
| 180 | memory_resource* upstream, void* p, size_t bytes, size_t align) { |
no test coverage detected