MCPcopy Create free account
hub / github.com/antirez/ds4 / raxDebugShowNode

Function raxDebugShowNode

rax.c:2686–2700  ·  view source on GitHub ↗

Used by debugnode() macro to show info about a given node. */

Source from the content-addressed store, hash-verified

2684
2685/* Used by debugnode() macro to show info about a given node. */
2686void raxDebugShowNode(const char *msg, raxNode *n) {
2687 if (raxDebugMsg == 0) return;
2688 printf("%s: %p [%.*s] key:%d size:%d children:",
2689 msg, (void*)n, (int)n->size, (char*)n->data, n->iskey, n->size);
2690 int numcld = n->iscompr ? 1 : n->size;
2691 raxNode **cldptr = raxNodeLastChildPtr(n) - (numcld-1);
2692 while(numcld--) {
2693 raxNode *child;
2694 memcpy(&child,cldptr,sizeof(child));
2695 cldptr++;
2696 printf("%p ", (void*)child);
2697 }
2698 printf("\n");
2699 fflush(stdout);
2700}
2701
2702/* Touch all the nodes of a tree returning a check sum. This is useful
2703 * in order to make Valgrind detect if there is something wrong while

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected