You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2015/11/02 21:23:40 UTC

trafficserver git commit: TS-3883: Fix loose alignment problem (regression).

Repository: trafficserver
Updated Branches:
  refs/heads/master f648b17ea -> a33b8d602


TS-3883: Fix loose alignment problem (regression).


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a33b8d60
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a33b8d60
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a33b8d60

Branch: refs/heads/master
Commit: a33b8d602ffd3470d1688ebe2d1489c4cdf52dd1
Parents: f648b17
Author: Alan M. Carroll <so...@yahoo-inc.com>
Authored: Mon Nov 2 14:23:03 2015 -0600
Committer: Alan M. Carroll <so...@yahoo-inc.com>
Committed: Mon Nov 2 14:23:03 2015 -0600

----------------------------------------------------------------------
 lib/ts/ink_queue.cc | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a33b8d60/lib/ts/ink_queue.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_queue.cc b/lib/ts/ink_queue.cc
index 18b6395..5da2f05 100644
--- a/lib/ts/ink_queue.cc
+++ b/lib/ts/ink_queue.cc
@@ -133,6 +133,10 @@ ink_freelist_init(InkFreeList **fl, const char *name, uint32_t type_size, uint32
   f->name = name;
   /* quick test for power of 2 */
   ink_assert(!(alignment & (alignment - 1)));
+  // It is never useful to have alignment requirement looser than a page size
+  // so clip it. This makes the item alignment checks in the actual allocator simpler.
+  if (alignment > ats_pagesize())
+    alignment = ats_pagesize();
   f->alignment = alignment;
   // Make sure we align *all* the objects in the allocation, not just the first one
   f->type_size = INK_ALIGN(type_size, alignment);