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
91d33db5
Commit
91d33db5
authored
Jan 08, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add vsmw_cluster arg to VSMW_Alloc[vf]()
parent
89e295c8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
12 deletions
+15
-12
cache_shmlog.c
bin/varnishd/cache/cache_shmlog.c
+1
-1
common_vsc.c
bin/varnishd/common/common_vsc.c
+1
-1
common_vsmw.c
bin/varnishd/common/common_vsmw.c
+6
-5
vsmw.h
bin/varnishd/common/vsmw.h
+4
-2
mgt_shmem.c
bin/varnishd/mgt/mgt_shmem.c
+3
-3
No files found.
bin/varnishd/cache/cache_shmlog.c
View file @
91d33db5
...
...
@@ -509,7 +509,7 @@ VSM_Init(void)
AN
(
VSC_C_main
);
AN
(
heritage
.
proc_vsmw
);
vsl_head
=
VSMW_Allocf
(
heritage
.
proc_vsmw
,
VSL_CLASS
,
vsl_head
=
VSMW_Allocf
(
heritage
.
proc_vsmw
,
NULL
,
VSL_CLASS
,
cache_param
->
vsl_space
,
VSL_CLASS
);
AN
(
vsl_head
);
vsl_segsize
=
((
cache_param
->
vsl_space
-
sizeof
*
vsl_head
)
/
...
...
bin/varnishd/common/common_vsc.c
View file @
91d33db5
...
...
@@ -83,7 +83,7 @@ vrt_vsc_mksegv(const char *class, size_t payload, const char *fmt, va_list va)
co
=
PRNDUP
(
sizeof
(
struct
vsc_head
));
ALLOC_OBJ
(
vsg
,
VSC_SEG_MAGIC
);
AN
(
vsg
);
vsg
->
seg
=
VSMW_Allocv
(
heritage
.
proc_vsmw
,
class
,
vsg
->
seg
=
VSMW_Allocv
(
heritage
.
proc_vsmw
,
NULL
,
class
,
co
+
PRNDUP
(
payload
),
fmt
,
va
);
AN
(
vsg
->
seg
);
vsg
->
vsm
=
heritage
.
proc_vsmw
;
...
...
bin/varnishd/common/common_vsmw.c
View file @
91d33db5
...
...
@@ -219,14 +219,15 @@ VSMW_DestroyCluster(struct vsmw *vsmw, struct vsmw_cluster **vcp)
/*--------------------------------------------------------------------*/
void
*
VSMW_Allocv
(
struct
vsmw
*
vsmw
,
const
char
*
class
,
size_t
len
,
VSMW_Allocv
(
struct
vsmw
*
vsmw
,
struct
vsmw_cluster
*
vc
,
const
char
*
class
,
size_t
len
,
const
char
*
fmt
,
va_list
va
)
{
struct
vsmwseg
*
seg
;
struct
vsmw_cluster
*
vc
;
int
fd
;
CHECK_OBJ_NOTNULL
(
vsmw
,
VSMW_MAGIC
);
(
void
)
vc
;
ALLOC_OBJ
(
seg
,
VSMWSEG_MAGIC
);
AN
(
seg
);
...
...
@@ -256,14 +257,14 @@ VSMW_Allocv(struct vsmw *vsmw, const char *class, size_t len,
}
void
*
VSMW_Allocf
(
struct
vsmw
*
vsmw
,
const
char
*
class
,
size_t
len
,
const
char
*
fmt
,
...)
VSMW_Allocf
(
struct
vsmw
*
vsmw
,
struct
vsmw_cluster
*
vc
,
const
char
*
class
,
size_t
len
,
const
char
*
fmt
,
...)
{
va_list
ap
;
void
*
p
;
va_start
(
ap
,
fmt
);
p
=
VSMW_Allocv
(
vsmw
,
class
,
len
,
fmt
,
ap
);
p
=
VSMW_Allocv
(
vsmw
,
vc
,
class
,
len
,
fmt
,
ap
);
va_end
(
ap
);
return
(
p
);
}
...
...
bin/varnishd/common/vsmw.h
View file @
91d33db5
...
...
@@ -37,8 +37,10 @@ struct vsmw_cluster;
struct
vsmw_cluster
*
VSMW_NewCluster
(
struct
vsmw
*
,
size_t
,
const
char
*
);
void
VSMW_DestroyCluster
(
struct
vsmw
*
,
struct
vsmw_cluster
**
);
void
*
VSMW_Allocv
(
struct
vsmw
*
,
const
char
*
,
size_t
,
const
char
*
,
va_list
);
void
*
VSMW_Allocf
(
struct
vsmw
*
,
const
char
*
,
size_t
,
const
char
*
,
...);
void
*
VSMW_Allocv
(
struct
vsmw
*
,
struct
vsmw_cluster
*
,
const
char
*
,
size_t
,
const
char
*
,
va_list
);
void
*
VSMW_Allocf
(
struct
vsmw
*
,
struct
vsmw_cluster
*
,
const
char
*
,
size_t
,
const
char
*
,
...);
void
VSMW_Free
(
struct
vsmw
*
,
void
**
);
struct
vsmw
*
VSMW_New
(
int
,
int
,
const
char
*
);
...
...
bin/varnishd/mgt/mgt_shmem.c
View file @
91d33db5
...
...
@@ -58,7 +58,7 @@ mgt_SHM_static_alloc(const void *ptr, ssize_t size,
{
void
*
p
;
p
=
VSMW_Allocf
(
mgt_vsmw
,
class
,
size
,
"%s"
,
ident
);
p
=
VSMW_Allocf
(
mgt_vsmw
,
NULL
,
class
,
size
,
"%s"
,
ident
);
AN
(
p
);
memcpy
(
p
,
ptr
,
size
);
}
...
...
@@ -122,13 +122,13 @@ mgt_SHM_ChildNew(void)
MCH_Fd_Inherit
(
heritage
.
vsm_fd
,
"VSMW"
);
heritage
.
param
=
VSMW_Allocf
(
mgt_vsmw
,
VSM_CLASS_PARAM
,
heritage
.
param
=
VSMW_Allocf
(
mgt_vsmw
,
NULL
,
VSM_CLASS_PARAM
,
sizeof
*
heritage
.
param
,
""
);
AN
(
heritage
.
param
);
*
heritage
.
param
=
mgt_param
;
heritage
.
panic_str_len
=
64
*
1024
;
heritage
.
panic_str
=
VSMW_Allocf
(
mgt_vsmw
,
"Panic"
,
heritage
.
panic_str
=
VSMW_Allocf
(
mgt_vsmw
,
NULL
,
"Panic"
,
heritage
.
panic_str_len
,
""
);
AN
(
heritage
.
panic_str
);
}
...
...
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