buddy storage: Adjust to changed STV API

Ref: https://github.com/varnishcache/varnish-cache/pull/4056
parent c57d7879
......@@ -172,6 +172,8 @@ sbu_objallocwithnuke(/*lint -e{818}*/ struct worker *wrk,
reqs = BUDDY_REQS_STK(buddy, 2);
if (size == 0)
size = (size_t)1 << stvbu->tune.chunk_exponent;
assert(size > 0);
if (flags & LESS_MEM_ALLOCED_IS_OK)
......@@ -401,7 +403,12 @@ sbu_getspace(struct worker *wrk, struct objcore *oc, ssize_t *sz,
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
AN(sz);
AN(ptr);
assert(*sz > 0);
assert(*sz >= 0);
// XXX VC >7.4 remove workaround
// https://github.com/varnishcache/varnish-cache/pull/4056
if (*sz == cache_param->fetch_chunksize)
*sz = 0;
CAST_OBJ_NOTNULL(o, oc->stobj->priv, OBU_MAGIC);
CHECK_OBJ_NOTNULL(oc->boc, BOC_MAGIC);
......
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