Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
slash
Commits
7a9488ec
Unverified
Commit
7a9488ec
authored
Nov 29, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tigthen assertions
Motivated by #40
parent
6a5727ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
fellow_cache.c
src/fellow_cache.c
+13
-1
No files found.
src/fellow_cache.c
View file @
7a9488ec
...
...
@@ -1110,8 +1110,12 @@ fellow_cache_lru_chgbatch_apply(struct fellow_lru_chgbatch *lcb)
//DBG("%u/%u", lcb->n, !VTAILQ_EMPTY(&lcb->add));
if
(
lcb
->
n_rem
==
0
&&
VTAILQ_EMPTY
(
&
lcb
->
add
))
if
(
lcb
->
n_rem
==
0
&&
(
VTAILQ_EMPTY
(
&
lcb
->
add
)
||
lcb
->
n_add
==
0
))
{
AZ
(
lcb
->
n_rem
);
AZ
(
lcb
->
n_add
);
assert
(
VTAILQ_EMPTY
(
&
lcb
->
add
));
return
;
}
fco
=
lcb
->
fco
;
CHECK_OBJ_NOTNULL
(
fco
,
FELLOW_CACHE_OBJ_MAGIC
);
...
...
@@ -1121,15 +1125,22 @@ fellow_cache_lru_chgbatch_apply(struct fellow_lru_chgbatch *lcb)
n
=
lcb
->
n_rem
;
while
(
n
--
)
{
fcs
=
lcb
->
fcs
[
n
];
CHECK_OBJ_NOTNULL
(
fcs
,
FELLOW_CACHE_SEG_MAGIC
);
assert
(
fcs
->
fco
==
fco
);
AZ
(
fcs
->
lcb_add
);
AN
(
fcs
->
lcb_remove
);
fcs
->
lcb_remove
=
0
;
}
n
=
0
;
VTAILQ_FOREACH
(
fcs
,
&
lcb
->
add
,
lru_list
)
{
CHECK_OBJ_NOTNULL
(
fcs
,
FELLOW_CACHE_SEG_MAGIC
);
assert
(
fcs
->
fco
==
fco
);
AZ
(
fcs
->
lcb_remove
);
AN
(
fcs
->
lcb_add
);
fcs
->
lcb_add
=
0
;
n
++
;
}
assert
(
n
==
lcb
->
n_add
);
AZ
(
pthread_mutex_lock
(
&
lru
->
lru_mtx
));
lru
->
n
+=
lcb
->
n_add
;
...
...
@@ -1144,6 +1155,7 @@ fellow_cache_lru_chgbatch_apply(struct fellow_lru_chgbatch *lcb)
VTAILQ_CONCAT
(
&
lru
->
lru_head
,
&
lcb
->
add
,
lru_list
);
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
lcb
->
n_add
=
0
;
assert
(
VTAILQ_EMPTY
(
&
lcb
->
add
));
AZ
(
lcb
->
n_rem
);
}
...
...
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