Skip to content
Permalink
Browse files

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

for clients what the _index entry is about.
  • Loading branch information...
bsdphk committed Aug 13, 2019
1 parent ea995d6 commit 29d940014dccab1cb820db1cdf3a907558f5b059
Showing with 6 additions and 1 deletion.
  1. +6 −1 bin/varnishd/common/common_vsmw.c
@@ -137,6 +137,9 @@ struct vsmw {
uint64_t nsubs;
};

/* Allocations in clusters never start at offset zero */
#define VSM_CLUSTER_OFFSET 16

/*--------------------------------------------------------------------*/

static void
@@ -307,7 +310,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);

0 comments on commit 29d9400

Please sign in to comment.
You can’t perform that action at this time.