33 size -= ((uintptr_t)mprotect_addr) - ((uintptr_t)addr);
49 int num_headers_in_partial_bucket =
52 if (num_headers_in_partial_bucket + num_headers_in_bucket <
53 num_headers_per_bucket) {
58 for (i = 1; i < num_headers_in_partial_bucket; i++) {
59 partial_bucket_tail = partial_bucket_tail->
p_next;
61 partial_bucket_tail->
p_next = bucket;
63 num_headers_in_partial_bucket + num_headers_in_bucket;
68 for (i = 1; i < num_headers_per_bucket - num_headers_in_bucket;
70 partial_bucket_header = partial_bucket_header->
p_next;
73 if (num_headers_in_partial_bucket + num_headers_in_bucket !=
74 num_headers_per_bucket) {
75 new_partial_bucket = partial_bucket_header->
p_next;
77 num_headers_per_bucket -
78 (num_headers_in_partial_bucket + num_headers_in_bucket);
80 partial_bucket_header->
p_next = bucket;
91 size_t header_size,
size_t header_offset,
size_t page_size,
93 uint32_t num_lp_type_requests,
size_t alignment_hint,
101 if (p_mprotect_config) {
118 for (i = 0; i < num_lp_type_requests; i++) {
149 while ((p_page_lifo_elem =
165 &p_global_pool->p_mem_page_empty);
206 for (i = 0; i < bucket_index; i++) {
215 p_local_pool->
buckets[bucket_index]);
234 *p_bucket = popped_bucket;
238 const size_t header_size = p_global_pool->
header_size;
239 int num_headers = 0, i;
246 if ((p_page_lifo_elem =
252 const size_t page_size = p_global_pool->
page_size;
260 &lp_type, &p_alloc_mem);
263 if (num_headers != 0) {
273 p_page->
mem = p_alloc_mem;
281 int num_required = num_headers_per_bucket - num_headers;
282 if (num_required < num_provided)
283 num_provided = num_required;
288 (
void *)(((
char *)p_mem_extra) + header_size * num_provided);
302 void *p_cur_mem_page;
305 &p_global_pool->p_mem_page_empty);
317 p_local_tail->
p_next = p_head;
321 for (i = 1; i < num_provided; i++) {
332 const size_t protect_offset =
334 const size_t protect_page_size =
336 const size_t protect_alignment =
342 protect_page_size, protect_alignment,
347 for (i = 1; i < num_provided; i++) {
355 header_offset + protect_offset),
356 protect_page_size, protect_alignment,
364 num_headers += num_provided;
365 if (num_headers == num_headers_per_bucket) {