From b6e423bfa5d87c46c51266b1aa6209165dba3c0f Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Mon, 3 Apr 2017 10:50:44 +0000 Subject: Follow up to r1788334: apr_allocator_align() should take an allocator as argument, for better scalability of the API. Update apr_bucket_alloc_aligned_floor() from r1788335 accordingly. Suggested by ivan. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1789947 13f79535-47bb-0310-9956-ffa450edef68 --- buckets/apr_buckets_alloc.c | 8 +++++--- buckets/apr_buckets_file.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'buckets') diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c index 833621c4a..79ac9293e 100644 --- a/buckets/apr_buckets_alloc.c +++ b/buckets/apr_buckets_alloc.c @@ -123,17 +123,19 @@ APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list) #endif } -APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_size_t size) +APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_bucket_alloc_t *list, + apr_size_t size) { if (size <= SMALL_NODE_SIZE) { size = SMALL_NODE_SIZE; } else { if (size < APR_MEMNODE_T_SIZE) { - size = apr_allocator_align(0); + size = apr_allocator_align(list->allocator, 0); } else { - size = apr_allocator_align(size - APR_MEMNODE_T_SIZE); + size = apr_allocator_align(list->allocator, + size - APR_MEMNODE_T_SIZE); } size -= APR_MEMNODE_T_SIZE; } diff --git a/buckets/apr_buckets_file.c b/buckets/apr_buckets_file.c index 7cea3a40d..82bb2d172 100644 --- a/buckets/apr_buckets_file.c +++ b/buckets/apr_buckets_file.c @@ -205,7 +205,7 @@ APR_DECLARE(apr_status_t) apr_bucket_file_set_buf_size(apr_bucket *e, a->read_size = APR_BUCKET_BUFF_SIZE; } else { - apr_size_t floor = apr_bucket_alloc_aligned_floor(size); + apr_size_t floor = apr_bucket_alloc_aligned_floor(e->list, size); a->read_size = (size < floor) ? size : floor; } -- cgit v1.2.1