summaryrefslogtreecommitdiff
path: root/buckets
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2017-04-03 10:50:44 +0000
committerYann Ylavic <ylavic@apache.org>2017-04-03 10:50:44 +0000
commitb6e423bfa5d87c46c51266b1aa6209165dba3c0f (patch)
tree276a00ac8683f57c075a56b63aa192c6ddff925b /buckets
parente20d3d3a2017d7086bde19814cdf8ef93da92f34 (diff)
downloadapr-b6e423bfa5d87c46c51266b1aa6209165dba3c0f.tar.gz
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
Diffstat (limited to 'buckets')
-rw-r--r--buckets/apr_buckets_alloc.c8
-rw-r--r--buckets/apr_buckets_file.c2
2 files changed, 6 insertions, 4 deletions
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;
}