Commit 3eb07d87 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Align allocations to 16 bytes, for easier counting in hexdumps



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4276 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent d9f9a945
......@@ -1312,6 +1312,12 @@ smp_alloc(struct stevedore *st, size_t size, struct objcore *oc)
CAST_OBJ_NOTNULL(sc, st->priv, SMP_SC_MAGIC);
Lck_Lock(&sc->mtx);
/* Alignment */
if (size & 0xf) {
size |= 0xf;
size += 1;
}
for (tries = 0; tries < 3; tries++) {
sg = sc->cur_seg;
CHECK_OBJ_NOTNULL(sg, SMP_SEG_MAGIC);
......@@ -1333,6 +1339,7 @@ smp_alloc(struct stevedore *st, size_t size, struct objcore *oc)
size = left - overhead;
needed = overhead + size;
assert(needed <= left);
size &= ~15;
}
/* If there is space, fine */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment