github.com/moontrade/nogc@v0.1.7/collections/tree/main.cc (about) 1 #include <limits.h> 2 #include <stdint.h> 3 #include <stdio.h> 4 #include <stdlib.h> 5 #include <time.h> 6 #include <pthread.h> 7 #include <atomic> 8 #include <thread> 9 #include "art.h" 10 11 #include "../../sync/lock.h" 12 13 // int main(int argc, char *argv[]) { 14 // art_tree tree; 15 // 16 // art_tree_init(&tree); 17 // art_tree_init_lock(&tree); // create exclusive lock 18 // 19 // art_insert(&tree, (const unsigned char*)"00001", 5, NULL_VALUE); 20 // art_insert(&tree, (const unsigned char*)"00002", 5, NULL_VALUE); 21 // 22 // printf("bytes: %u\n", (unsigned int)tree.bytes); 23 // 24 // art_delete(&tree, (const unsigned char*)"00002", 5); 25 // printf("bytes: %u\n", (unsigned int)tree.bytes); 26 // printf("sizeof lock: %u\n", (unsigned int)moontrade_rwlock_size()); 27 // art_tree_destroy(&tree); 28 // }