Commit bc4c9526 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Give -spersistent its own ->allocobj() method, which is just a clone

of the default method for now.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5560 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2b5e8364
...@@ -69,6 +69,9 @@ SVNID("$Id$") ...@@ -69,6 +69,9 @@ SVNID("$Id$")
#define OC_F_NEEDFIXUP OC_F_PRIV #define OC_F_NEEDFIXUP OC_F_PRIV
static struct storage *smp_alloc(struct stevedore *st, size_t size,
struct objcore *oc);
/* /*
* Context for a signature. * Context for a signature.
* *
...@@ -1285,6 +1288,28 @@ smp_close(const struct stevedore *st) ...@@ -1285,6 +1288,28 @@ smp_close(const struct stevedore *st)
/* XXX: reap thread */ /* XXX: reap thread */
} }
/*--------------------------------------------------------------------
* Allocate an object
*/
static struct object *
smp_allocobj(struct stevedore *stv, struct sess *sp, unsigned ltot,
struct stv_objsecrets *soc)
{
struct object *o;
struct storage *st;
st = smp_alloc(stv, ltot, sp->objcore);
XXXAN(st);
xxxassert(st->space >= ltot);
ltot = st->len = st->space;
o = STV_MkObject(sp, st->ptr, ltot, soc);
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
o->objstore = st;
return (o);
}
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
* Designate object * Designate object
*/ */
...@@ -1503,6 +1528,7 @@ const struct stevedore smp_stevedore = { ...@@ -1503,6 +1528,7 @@ const struct stevedore smp_stevedore = {
.open = smp_open, .open = smp_open,
.close = smp_close, .close = smp_close,
.alloc = smp_alloc, .alloc = smp_alloc,
.allocobj = smp_allocobj,
.object = smp_object, .object = smp_object,
.free = smp_free, .free = smp_free,
.trim = smp_trim, .trim = smp_trim,
......
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