apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1789956 - in /apr/apr-util/branches/1.6.x: ./ buckets/apr_buckets_alloc.c buckets/apr_buckets_file.c include/apr_buckets.h
Date Mon, 03 Apr 2017 11:26:46 GMT
Author: ylavic
Date: Mon Apr  3 11:26:45 2017
New Revision: 1789956

URL: http://svn.apache.org/viewvc?rev=1789956&view=rev
Log:
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.


Modified:
    apr/apr-util/branches/1.6.x/   (props changed)
    apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c
    apr/apr-util/branches/1.6.x/buckets/apr_buckets_file.c
    apr/apr-util/branches/1.6.x/include/apr_buckets.h

Propchange: apr/apr-util/branches/1.6.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr  3 11:26:45 2017
@@ -1,4 +1,4 @@
-/apr/apr/trunk:781403,781409,784519,784592,789965,794508,917837-917838,982408-982409,998533,1086937,1127053,1127648,1128838,1129433,1133587,1207704,1210524,1211987,1214516,1308087,1308131,1308318,1327636,1340286,1346865,1357761,1357772,1357780,1357966,1357968,1357979,1358295,1358480,1361811,1362241,1362248,1362252,1362255,1363076,1369681,1370626,1371811,1371817,1371919,1371923,1382174,1389154,1389169,1390461,1390477,1402870,1402897,1402903,1402907,1406088,1422413,1425356,1426442,1426448,1438960,1449308,1449314,1460185,1460243-1460244,1462219,1462224,1484271,1493715,1495887,1495889,1496407,1516261,1523479,1529554,1531009,1541054,1543399,1544846,1618843,1619438,1625247,1626561,1648830,1711657,1722547,1728958,1728963,1747941,1751567,1751806,1751898,1752008,1763665,1763667,1763669,1763672-1763673,1763842-1763843,1765378,1772414,1778153,1781391,1782042,1782045,1788335
+/apr/apr/trunk:781403,781409,784519,784592,789965,794508,917837-917838,982408-982409,998533,1086937,1127053,1127648,1128838,1129433,1133587,1207704,1210524,1211987,1214516,1308087,1308131,1308318,1327636,1340286,1346865,1357761,1357772,1357780,1357966,1357968,1357979,1358295,1358480,1361811,1362241,1362248,1362252,1362255,1363076,1369681,1370626,1371811,1371817,1371919,1371923,1382174,1389154,1389169,1390461,1390477,1402870,1402897,1402903,1402907,1406088,1422413,1425356,1426442,1426448,1438960,1449308,1449314,1460185,1460243-1460244,1462219,1462224,1484271,1493715,1495887,1495889,1496407,1516261,1523479,1529554,1531009,1541054,1543399,1544846,1618843,1619438,1625247,1626561,1648830,1711657,1722547,1728958,1728963,1747941,1751567,1751806,1751898,1752008,1763665,1763667,1763669,1763672-1763673,1763842-1763843,1765378,1772414,1778153,1781391,1782042,1782045,1788335,1789947
 /apr/apr-util/branches/1.3.x:896410,1154885
 /apr/apr-util/branches/1.4.x:1126217,1211211,1211219,1211223,1211330
 /apr/apr-util/branches/1.5.x:1757430

Modified: apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c?rev=1789956&r1=1789955&r2=1789956&view=diff
==============================================================================
--- apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c (original)
+++ apr/apr-util/branches/1.6.x/buckets/apr_buckets_alloc.c Mon Apr  3 11:26:45 2017
@@ -122,7 +122,8 @@ APU_DECLARE_NONSTD(void) apr_bucket_allo
 #endif
 }
 
-APU_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_size_t size)
+APU_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;
@@ -130,10 +131,11 @@ APU_DECLARE_NONSTD(apr_size_t) apr_bucke
     else {
 #if APR_VERSION_AT_LEAST(1,6,0)
         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);
         }
 #else
         /* Assumes the minimum (default) allocator's boundary of 4K and

Modified: apr/apr-util/branches/1.6.x/buckets/apr_buckets_file.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.6.x/buckets/apr_buckets_file.c?rev=1789956&r1=1789955&r2=1789956&view=diff
==============================================================================
--- apr/apr-util/branches/1.6.x/buckets/apr_buckets_file.c (original)
+++ apr/apr-util/branches/1.6.x/buckets/apr_buckets_file.c Mon Apr  3 11:26:45 2017
@@ -205,7 +205,7 @@ APU_DECLARE(apr_status_t) apr_bucket_fil
         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;
     }
 

Modified: apr/apr-util/branches/1.6.x/include/apr_buckets.h
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.6.x/include/apr_buckets.h?rev=1789956&r1=1789955&r2=1789956&view=diff
==============================================================================
--- apr/apr-util/branches/1.6.x/include/apr_buckets.h (original)
+++ apr/apr-util/branches/1.6.x/include/apr_buckets.h Mon Apr  3 11:26:45 2017
@@ -967,10 +967,13 @@ APU_DECLARE_NONSTD(void) apr_bucket_allo
  * Get the aligned size corresponding to the requested size, but minus the
  * allocator(s) overhead such that the allocation would remain in the
  * same boundary.
+ * @param list The allocator from which to the memory would be allocated.
  * @param size The requested size.
  * @return The corresponding aligned/floored size.
  */
-APU_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_size_t size);
+APU_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_bucket_alloc_t *list,
+                                                              apr_size_t size)
+                         __attribute__((nonnull(1)));
 
 /**
  * Allocate memory for use by the buckets.



Mime
View raw message