* Free radix node. */
| 125 | * Free radix node. |
| 126 | */ |
| 127 | static __inline void |
| 128 | pctrie_node_put(struct pctrie *ptree, struct pctrie_node *node, |
| 129 | pctrie_free_t freefn, int8_t last) |
| 130 | { |
| 131 | #ifdef INVARIANTS |
| 132 | int slot; |
| 133 | |
| 134 | KASSERT(node->pn_count == 0, |
| 135 | ("pctrie_node_put: node %p has %d children", node, |
| 136 | node->pn_count)); |
| 137 | for (slot = 0; slot < PCTRIE_COUNT; slot++) { |
| 138 | if (slot == last) |
| 139 | continue; |
| 140 | KASSERT(smr_unserialized_load(&node->pn_child[slot], true) == |
| 141 | NULL, ("pctrie_node_put: node %p has a child", node)); |
| 142 | } |
| 143 | #endif |
| 144 | node->pn_last = last + 1; |
| 145 | freefn(ptree, node); |
| 146 | } |
| 147 | |
| 148 | /* |
| 149 | * Return the position in the array for a given level. |
no outgoing calls
no test coverage detected