Lines Matching refs:right

104 //   Freed memory areas are eagerly coalesced with free left/right neighbors. If
105 // the new free area covers an entire OS allocation (i.e., its left and right
108 // Exception: to avoid OS free/alloc churn when right on the edge, the heap
158 // NULL in the address portion of this field. Left and right sentinels
162 // The right sentinel will have 0 in this field.
273 // will do the right thing (the carry propagates up for the round numbers
405 // OS (in which case the left/right sentinels are freed as well). |address|
460 static void FixLeftPointer(header_t* right, header_t* new_left) {
461 int tag = (uintptr_t)right->left & 1;
462 right->left = (header_t*)(((uintptr_t)new_left & ~1) | tag);
546 // of an OS allocation and that a2 is "right after" it.
822 header_t* right = right_header(&free_area->header);
823 if (is_end_of_os_allocation((char*)right)) {
825 (char*)ROUNDUP((uintptr_t)right, PAGE_SIZE);
845 // Right sentinel, not free, stops attempts to coalesce right.
859 // between the page edge and the first allocation to the right
862 (char*)ROUNDDOWN((uintptr_t)(right - 1), PAGE_SIZE);
882 FixLeftPointer(right, (header_t*)new_os_allocation_start);
889 FixLeftPointer(right, (header_t*)new_free);
938 // allocations being placed right next to large allocations, hindering
941 header_t* right = right_header(&head->header);
945 FixLeftPointer(right, (header_t*)free);
986 header_t* right = right_header(unaligned_header);
988 FixLeftPointer(right, header);
1010 header_t* right = right_header(header);
1011 if (is_tagged_as_free(right)) {
1013 unlink_free_unknown_bucket((free_t*)right);
1014 header_t* right_right = right_header(right);
1016 free_memory(left, left->left, left->size + size + right->size);
1019 FixLeftPointer(right, left);
1023 header_t* right = right_header(header);
1024 if (is_tagged_as_free(right)) {
1025 // Coalesce only right.
1026 header_t* right_right = right_header(right);
1027 unlink_free_unknown_bucket((free_t*)right);
1029 free_memory(header, left, size + right->size);
1066 // Set up the right sentinel. Its |left| field will not have FREE_BIT bit
1067 // set, stopping attempts to coalesce right.