Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
f07157f7
Commit
f07157f7
authored
Jun 22, 2021
by
Martin Blix Grydeland
Committed by
Dridi Boukelmoune
Oct 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simple STV temp buffer implementation
Conflicts: bin/varnishd/storage/storage_simple.c
parent
1518c09d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
storage_simple.c
bin/varnishd/storage/storage_simple.c
+37
-0
storage_simple.h
bin/varnishd/storage/storage_simple.h
+3
-0
No files found.
bin/varnishd/storage/storage_simple.c
View file @
f07157f7
...
...
@@ -44,6 +44,10 @@
/*-------------------------------------------------------------------*/
static
struct
storage
*
objallocwithnuke
(
struct
worker
*
,
const
struct
stevedore
*
,
size_t
size
,
int
flags
);
static
struct
storage
*
sml_stv_alloc
(
const
struct
stevedore
*
stv
,
size_t
size
,
int
flags
)
{
...
...
@@ -159,6 +163,39 @@ SML_allocobj(struct worker *wrk, const struct stevedore *stv,
return
(
1
);
}
void
*
v_matchproto_
(
storage_allocbuf_t
)
SML_AllocBuf
(
struct
worker
*
wrk
,
const
struct
stevedore
*
stv
,
size_t
size
,
uintptr_t
*
ppriv
)
{
struct
storage
*
st
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
stv
,
STEVEDORE_MAGIC
);
AN
(
ppriv
);
if
(
size
>
UINT_MAX
)
return
(
NULL
);
st
=
objallocwithnuke
(
wrk
,
stv
,
size
,
0
);
if
(
st
==
NULL
)
return
(
NULL
);
assert
(
st
->
space
>=
size
);
st
->
len
=
size
;
*
ppriv
=
(
uintptr_t
)
st
;
return
(
st
->
ptr
);
}
void
v_matchproto_
(
storage_freebuf_t
)
SML_FreeBuf
(
struct
worker
*
wrk
,
const
struct
stevedore
*
stv
,
uintptr_t
priv
)
{
struct
storage
*
st
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
stv
,
STEVEDORE_MAGIC
);
CAST_OBJ_NOTNULL
(
st
,
(
void
*
)
priv
,
STORAGE_MAGIC
);
sml_stv_free
(
stv
,
st
);
}
/*---------------------------------------------------------------------
*/
...
...
bin/varnishd/storage/storage_simple.h
View file @
f07157f7
...
...
@@ -66,6 +66,9 @@ extern const struct obj_methods SML_methods;
struct
object
*
SML_MkObject
(
const
struct
stevedore
*
,
struct
objcore
*
,
void
*
ptr
);
void
*
SML_AllocBuf
(
struct
worker
*
,
const
struct
stevedore
*
,
size_t
,
uintptr_t
*
);
void
SML_FreeBuf
(
struct
worker
*
,
const
struct
stevedore
*
,
uintptr_t
);
storage_allocobj_f
SML_allocobj
;
storage_panic_f
SML_panic
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment