source: CIVL/examples/omp/nas-dc/DC/rbt.h@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 923 bytes
Line 
1#ifndef _ADC_PARVIEW_TREE_DEF_H_
2#define _ADC_PARVIEW_TREE_DEF_H_
3
4#define MAX_TREE_HEIGHT 64
5enum{BLACK,RED};
6
7typedef struct treeNode{
8 struct treeNode *left;
9 struct treeNode *right;
10 uint32 clr;
11 int64 nodeMemPool[1];
12} treeNode;
13
14typedef struct RBTree{
15 treeNode root;
16 treeNode * mp;
17 uint32 count;
18 uint32 treeNodeSize;
19 uint32 nodeDataSize;
20 uint32 memoryLimit;
21 uint32 memaddr;
22 uint32 memoryIsFull;
23 uint32 freeNodeCounter;
24 uint32 nNodesLimit;
25 uint32 nd;
26 uint32 nm;
27 uint32 *drcts;
28 treeNode **nodes;
29 unsigned char * memPool;
30} RBTree;
31
32#define NEW_TREE_NODE(node_ptr,memPool,memaddr,treeNodeSize, \
33 freeNodeCounter,memoryIsFull) \
34 node_ptr=(struct treeNode*)(memPool+memaddr); \
35 memaddr+=treeNodeSize; \
36 (freeNodeCounter)--; \
37 if( freeNodeCounter == 0 ) { \
38 memoryIsFull = 1; \
39 }
40
41int32 TreeInsert(RBTree *tree, uint32 *attrs);
42
43#endif /* _ADC_PARVIEW_TREE_DEF_H_ */
Note: See TracBrowser for help on using the repository browser.