diff options
author | Yann Ylavic <ylavic@apache.org> | 2017-03-23 21:51:00 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2017-03-23 21:51:00 +0000 |
commit | 13417454879b0a42df0d9b8b06437566fce9dd97 (patch) | |
tree | eceb527a2f6be5271f097744341350f9ed0d6211 /buckets/apr_buckets_alloc.c | |
parent | b8deb32e55fd4777a50d6c667969dbc64da52e3c (diff) | |
download | apr-13417454879b0a42df0d9b8b06437566fce9dd97.tar.gz |
apr_buckets: Add apr_bucket_file_set_buf_size() which allows to configure
the size of the buffer used to read files.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1788335 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'buckets/apr_buckets_alloc.c')
-rw-r--r-- | buckets/apr_buckets_alloc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/buckets/apr_buckets_alloc.c b/buckets/apr_buckets_alloc.c index 3bfd5b07c..833621c4a 100644 --- a/buckets/apr_buckets_alloc.c +++ b/buckets/apr_buckets_alloc.c @@ -123,6 +123,24 @@ 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) +{ + if (size <= SMALL_NODE_SIZE) { + size = SMALL_NODE_SIZE; + } + else { + if (size < APR_MEMNODE_T_SIZE) { + size = apr_allocator_align(0); + } + else { + size = apr_allocator_align(size - APR_MEMNODE_T_SIZE); + } + size -= APR_MEMNODE_T_SIZE; + } + size -= SIZEOF_NODE_HEADER_T; + return size; +} + APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t in_size, apr_bucket_alloc_t *list) { |