Skip to content

Commit

Permalink
Minor refactor of sml_objfree(): Add local variable for stevedore
Browse files Browse the repository at this point in the history
  • Loading branch information
nigoroll committed Jul 9, 2023
1 parent 4716368 commit 046724d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/varnishd/storage/storage_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,21 +252,25 @@ sml_slim(struct worker *wrk, struct objcore *oc)
static void v_matchproto_(objfree_f)
sml_objfree(struct worker *wrk, struct objcore *oc)
{
const struct stevedore *stv;
struct storage *st;
struct object *o;

CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
sml_slim(wrk, oc);
stv = oc->stobj->stevedore;
CHECK_OBJ_NOTNULL(stv, STEVEDORE_MAGIC);
CAST_OBJ_NOTNULL(o, oc->stobj->priv, OBJECT_MAGIC);

sml_slim(wrk, oc);
st = o->objstore;
CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC);
FINI_OBJ(o);

if (oc->boc == NULL && oc->stobj->stevedore->lru != NULL)
if (oc->boc == NULL && stv->lru != NULL)
LRU_Remove(oc);

sml_stv_free(oc->stobj->stevedore, st);
sml_stv_free(stv, st);

memset(oc->stobj, 0, sizeof oc->stobj);

Expand Down

0 comments on commit 046724d

Please sign in to comment.