MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / node_cmp

Function node_cmp

deps/memkind/src/jemalloc/test/unit/ph.c:14–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12};
13
14static int
15node_cmp(const node_t *a, const node_t *b) {
16 int ret;
17
18 ret = (a->key > b->key) - (a->key < b->key);
19 if (ret == 0) {
20 /*
21 * Duplicates are not allowed in the heap, so force an
22 * arbitrary ordering for non-identical items with equal keys.
23 */
24 ret = (((uintptr_t)a) > ((uintptr_t)b))
25 - (((uintptr_t)a) < ((uintptr_t)b));
26 }
27 return ret;
28}
29
30static int
31node_cmp_magic(const node_t *a, const node_t *b) {

Callers 2

node_cmp_magicFunction · 0.70
ph.cFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected