Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140088483
D47320.id145866.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47320.id145866.diff
View Options
diff --git a/sys/sys/pctrie.h b/sys/sys/pctrie.h
--- a/sys/sys/pctrie.h
+++ b/sys/sys/pctrie.h
@@ -311,6 +311,14 @@
} \
\
static __inline __unused void \
+name##_PCTRIE_REMOVE_BASE(struct pctrie *ptree, \
+ struct pctrie_node *freenode) \
+{ \
+ if (freenode != NULL) \
+ freefn(ptree, freenode); \
+} \
+ \
+static __inline __unused void \
name##_PCTRIE_ITER_REMOVE(struct pctrie_iter *it) \
{ \
uint64_t *val; \
@@ -319,8 +327,7 @@
val = pctrie_iter_remove(it, &freenode); \
if (val == NULL) \
panic("%s: key not found", __func__); \
- if (freenode != NULL) \
- freefn(it->ptree, freenode); \
+ name##_PCTRIE_REMOVE_BASE(it->ptree, freenode); \
} \
\
static __inline __unused struct type * \
@@ -340,8 +347,7 @@
val = pctrie_remove_lookup(ptree, key, &freenode); \
if (val == NULL) \
panic("%s: key not found", __func__); \
- if (freenode != NULL) \
- freefn(ptree, freenode); \
+ name##_PCTRIE_REMOVE_BASE(ptree, freenode); \
} \
\
static __inline __unused struct type * \
@@ -351,8 +357,7 @@
struct pctrie_node *freenode; \
\
val = pctrie_remove_lookup(ptree, key, &freenode); \
- if (freenode != NULL) \
- freefn(ptree, freenode); \
+ name##_PCTRIE_REMOVE_BASE(ptree, freenode); \
return name##_PCTRIE_VAL2PTR(val); \
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 21, 2:10 AM (13 h, 7 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27104948
Default Alt Text
D47320.id145866.diff (1 KB)
Attached To
Mode
D47320: pctrie: reduce code duplication in PCTRIE_REMOVE_*
Attached
Detach File
Event Timeline
Log In to Comment