Added .gitignore
[SXSI/XMLTree.git] / bp.c
diff --git a/bp.c b/bp.c
index ebb98dc..6b7e296 100644 (file)
--- a/bp.c
+++ b/bp.c
@@ -4,7 +4,12 @@
 #define RANDOM\r
 \r
 int msize=0;\r
-#define mymalloc(p,n,f) {p =(__typeof__(p)) malloc((n)*sizeof(*p)); msize += (f)*(n)*sizeof(*p); /* if (f) printf("malloc %d bytes at line %d total %d\n",(n)*sizeof(*p),__LINE__,msize);  */ if ((p)==NULL) {printf("not enough memory (%d bytes) in line %d\n",msize,__LINE__); exit(1);};}\r
+#define mymalloc(p,n,f) {                              \\r
+  p = (__typeof__(p)) malloc((n)*sizeof(*p));          \\r
+if ((p)==NULL) {printf("not enough memory (%d bytes) in line %d\n",msize,__LINE__); \\r
+  exit(1);};                                                           \\r
+msize += (f)*(n)*sizeof(*p);                                           \\r
+;}\r
 \r
 int postorder_select_bsearch(bp *b,int s);\r
 \r
@@ -266,7 +271,7 @@ int bp_construct(bp *b,int n, pb *B, int opt)
   mymalloc(b->da,1,0);\r
   darray_construct(b->da,n,B, opt & OPT_FAST_PREORDER_SELECT);\r
   b->idx_size += b->da->idx_size;\r
-  //Kim : commented this and the following ones, they polute the printing of the query answer\r
+  //Kim: comment this and the following, they polute the printing of the xpath library\r
   //printf("preorder rank/select table: %d bytes (%1.2f bpc)\n",b->da->idx_size,(double)b->da->idx_size*8/n);\r
 \r
   make_matchtbl();\r
@@ -387,7 +392,7 @@ int bp_construct(bp *b,int n, pb *B, int opt)
   if (opt & OPT_LEAF) {\r
     mymalloc(b->da_leaf,1,0);\r
     darray_pat_construct(b->da_leaf, n, B, 2, 0x2, opt & OPT_FAST_LEAF_SELECT);\r
-    printf("leaf rank/select table: %d bytes (%1.2f bpc)\n",b->da_leaf->idx_size,(double)b->da_leaf->idx_size*8/n);\r
+    //printf("leaf rank/select table: %d bytes (%1.2f bpc)\n",b->da_leaf->idx_size,(double)b->da_leaf->idx_size*8/n);\r
     b->idx_size += b->da_leaf->idx_size;  \r
   } else {\r
     b->da_leaf = NULL;\r
@@ -396,7 +401,7 @@ int bp_construct(bp *b,int n, pb *B, int opt)
   if (opt & OPT_INORDER) {\r
     mymalloc(b->da_inorder,1,0);\r
     darray_pat_construct(b->da_inorder, n, B, 2, 0x1, opt & OPT_FAST_INORDER_SELECT);\r
-    printf("inorder rank/select table: %d bytes (%1.2f bpc)\n",b->da_inorder->idx_size,(double)b->da_inorder->idx_size*8/n);\r
+    //printf("inorder rank/select table: %d bytes (%1.2f bpc)\n",b->da_inorder->idx_size,(double)b->da_inorder->idx_size*8/n);\r
     b->idx_size += b->da_inorder->idx_size;\r
   } else {\r
     b->da_inorder = NULL;\r