Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 949a8e8

Browse files
committed
cache_hash: split objhead alloc / init
1 parent 4cd141b commit 949a8e8

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

bin/varnishd/cache/cache_hash.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,23 @@ VCF_RETURNS()
9393

9494
/*---------------------------------------------------------------------*/
9595

96-
static struct objhead *
97-
hsh_newobjhead(void)
96+
static void
97+
hsh_initobjhead(struct objhead *oh)
9898
{
99-
struct objhead *oh;
10099

101-
ALLOC_OBJ(oh, OBJHEAD_MAGIC);
102100
XXXAN(oh);
101+
INIT_OBJ(oh, OBJHEAD_MAGIC);
103102
oh->refcnt = 1;
104103
VTAILQ_INIT(&oh->objcs);
105104
VTAILQ_INIT(&oh->waitinglist);
106105
Lck_New(&oh->mtx, lck_objhdr);
106+
}
107+
108+
static struct objhead *
109+
hsh_newobjhead(void)
110+
{
111+
struct objhead *oh = malloc(sizeof *oh);
112+
hsh_initobjhead(oh);
107113
return (oh);
108114
}
109115

0 commit comments

Comments
 (0)