Lines Matching defs:align

32 static bool is_aligned_to(void* ptr, size_t align) {
35 void* result = std::align(align, 1, p2, space);
41 void* do_allocate(size_t bytes, size_t align) override {
43 return std::__libcpp_allocate(bytes, align);
47 void* result = std::__libcpp_allocate(bytes, align);
48 if (!is_aligned_to(result, align)) {
49 std::__libcpp_deallocate(result, bytes, align);
56 void do_deallocate(void* p, size_t bytes, size_t align) override { std::__libcpp_deallocate(p, bytes, align); }
157 void* unsynchronized_pool_resource::__adhoc_pool::__do_allocate(memory_resource* upstream, size_t bytes, size_t align) {
161 if (align < footer_align)
162 align = footer_align;
166 void* result = upstream->allocate(aligned_capacity, align);
171 h->__align_ = align;
177 memory_resource* upstream, void* p, size_t bytes, size_t align) {
278 int unsynchronized_pool_resource::__pool_index(size_t bytes, size_t align) const {
279 if (align > alignof(std::max_align_t) || bytes > (size_t(1) << __num_fixed_pools_))
283 bytes = (bytes > align) ? bytes : align;
341 void* unsynchronized_pool_resource::do_allocate(size_t bytes, size_t align) {
350 int i = __pool_index(bytes, align);
352 return __adhoc_pool_.__do_allocate(__res_, bytes, align);
395 void unsynchronized_pool_resource::do_deallocate(void* p, size_t bytes, size_t align) {
400 int i = __pool_index(bytes, align);
402 return __adhoc_pool_.__do_deallocate(__res_, p, bytes, align);
413 static void* align_down(size_t align, size_t size, void*& ptr, size_t& space) {
418 char* new_ptr = reinterpret_cast<char*>(reinterpret_cast<uintptr_t>(p1 - size) & ~(align - 1));
429 void* monotonic_buffer_resource::__initial_descriptor::__try_allocate_from_chunk(size_t bytes, size_t align) {
434 void* aligned_ptr = align_down(align, bytes, new_ptr, new_capacity);
440 void* monotonic_buffer_resource::__chunk_footer::__try_allocate_from_chunk(size_t bytes, size_t align) {
443 void* aligned_ptr = align_down(align, bytes, new_ptr, new_capacity);
449 void* monotonic_buffer_resource::do_allocate(size_t bytes, size_t align) {
462 if (void* result = __initial_.__try_allocate_from_chunk(bytes, align))
465 if (void* result = __chunks_->__try_allocate_from_chunk(bytes, align))
471 if (align < footer_align)
472 align = footer_align;
482 char* start = (char*)__res_->allocate(aligned_capacity, align);
488 footer->__align_ = align;
491 return __chunks_->__try_allocate_from_chunk(bytes, align);