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
333a1a0c
Commit
333a1a0c
authored
Mar 23, 2021
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate an FreeBSD kernel-ism
parent
7b64147e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
vtree.h
include/vtree.h
+5
-5
import_vtree_from_freebsd.sh
tools/import_vtree_from_freebsd.sh
+1
-0
No files found.
include/vtree.h
View file @
333a1a0c
...
...
@@ -333,10 +333,10 @@ struct { \
* that the left or right child of the tree node is "red".
*/
#define VRBT_UP(elm, field) (elm)->field.rbe_parent
#define VRBT_BITS(elm, field) (*(
__
uintptr_t *)&VRBT_UP(elm, field))
#define VRBT_RED_L ((
__
uintptr_t)1)
#define VRBT_RED_R ((
__
uintptr_t)2)
#define VRBT_RED_MASK ((
__
uintptr_t)3)
#define VRBT_BITS(elm, field) (*(uintptr_t *)&VRBT_UP(elm, field))
#define VRBT_RED_L ((uintptr_t)1)
#define VRBT_RED_R ((uintptr_t)2)
#define VRBT_RED_MASK ((uintptr_t)3)
#define VRBT_FLIP_LEFT(elm, field) (VRBT_BITS(elm, field) ^= VRBT_RED_L)
#define VRBT_FLIP_RIGHT(elm, field) (VRBT_BITS(elm, field) ^= VRBT_RED_R)
#define VRBT_RED_LEFT(elm, field) ((VRBT_BITS(elm, field) & VRBT_RED_L) != 0)
...
...
@@ -348,7 +348,7 @@ struct { \
#define VRBT_SET_PARENT(dst, src, field) do { \
VRBT_BITS(dst, field) &= VRBT_RED_MASK; \
VRBT_BITS(dst, field) |= (
__
uintptr_t)src; \
VRBT_BITS(dst, field) |= (uintptr_t)src; \
} while (
/*CONSTCOND*/
0)
#define VRBT_SET(elm, parent, field) do { \
...
...
tools/import_vtree_from_freebsd.sh
View file @
333a1a0c
...
...
@@ -19,6 +19,7 @@ sed -E '
485a\
AN(parent); \\
s/_SYS_TREE_H_/_VTREE_H_/
s/__uintptr_t/uintptr_t/g
s/SPLAY/VSPLAY/g
s/RB_/VRBT_/g
/(VRBT_FIND|VRBT_NFIND|VRBT_MINMAX)/{
...
...
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