Commit 2963be64 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Martin Blix Grydeland

Never allocate at offset zero in a cluster, this makes it faster

for clients what the _index entry is about.
parent ab0821e2
......@@ -138,6 +138,9 @@ struct vsmw {
uint64_t nsubs;
};
/* Allocations in clusters never start at offset zero */
#define VSM_CLUSTER_OFFSET 16
/*--------------------------------------------------------------------*/
static void
......@@ -311,7 +314,9 @@ VSMW_NewCluster(struct vsmw *vsmw, size_t len, const char *pfx)
struct vsmwseg *seg;
vsmw_do_lock();
vc = vsmw_newcluster(vsmw, len, pfx);
vc = vsmw_newcluster(vsmw, len + VSM_CLUSTER_OFFSET, pfx);
AN(vc);
vc->next += VSM_CLUSTER_OFFSET;
ALLOC_OBJ(seg, VSMWSEG_MAGIC);
AN(seg);
......
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