Changeset 6141 for trunk/ARBDB/adoptimize.c
- Timestamp:
- 14/08/09 16:29:27 (3 years ago)
- Files:
-
- 1 modified
-
trunk/ARBDB/adoptimize.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ARBDB/adoptimize.c
r5825 r6141 58 58 /****************************************************/ 59 59 60 #define COMPRESS ABLE(type) ((type) >= GB_BYTES && (type)<=GB_STRING)60 #define COMPRESSIBLE(type) ((type) >= GB_BYTES && (type)<=GB_STRING) 61 61 #define DICT_MEM_WEIGHT 4 62 62 … … 292 292 * if compressed==0: 293 293 * unsigned int last:1; ==1 -> this is the last block 294 * unsigned int len:6; length of uncompress able bytes294 * unsigned int len:6; length of uncompressible bytes 295 295 * char[len]; 296 296 * if compressed==1: … … 609 609 u_str dest; 610 610 u_str buffer; 611 cu_str unknown = source; /* start of uncompress able bytes */612 u_str lastUncompressed = NULL; /* ptr to start of last block of uncompress able bytes (in dest) */611 cu_str unknown = source; /* start of uncompressible bytes */ 612 u_str lastUncompressed = NULL; /* ptr to start of last block of uncompressible bytes (in dest) */ 613 613 614 614 #if defined(ASSERTION_USED) … … 658 658 } 659 659 660 while (length) { /* if there were uncompress able bytes */660 while (length) { /* if there were uncompressible bytes */ 661 661 int take = (int)min(length,63); 662 662 … … 799 799 int type = GB_TYPE(gbd); 800 800 801 if (COMPRESS ABLE(type)) {801 if (COMPRESSIBLE(type)) { 802 802 long size; 803 803 cu_str data = get_data_n_size(gbd, &size); … … 1511 1511 1512 1512 static int COUNT(GB_DICT_TREE tree) { 1513 /* counts sum of # of occur encies of tree */1513 /* counts sum of # of occurrences of tree */ 1514 1514 int cnt = 0; 1515 1515 … … 1575 1575 GB_DICT_TREE brother = tree.single->brother; 1576 1576 1577 tree.single->brother.exists = NULL; /* elsewise it would be free 'ed by free_dtree */1577 tree.single->brother.exists = NULL; /* elsewise it would be freed by free_dtree */ 1578 1578 free_dtree(tree); 1579 1579 *tree_pntr = tree = brother; … … 1811 1811 int type = GB_TYPE(gbd); 1812 1812 1813 if (COMPRESS ABLE(type)) {1813 if (COMPRESSIBLE(type)) { 1814 1814 long size; 1815 1815 cu_str data = get_data_n_size(gbd, &size); … … 2214 2214 /* 1. sorts the 'dict->offsets' by frequency 2215 2215 * (frequency of each offset is stored in the 'dict->resort' with the same index) 2216 * 2. initializes & sorts 'dict->resort' in alphabet hicalorder2216 * 2. initializes & sorts 'dict->resort' in alphabetic order 2217 2217 */ 2218 2218 int i; … … 2397 2397 int type = GB_TYPE(gbd); 2398 2398 2399 if (COMPRESS ABLE(type)) {2399 if (COMPRESSIBLE(type)) { 2400 2400 long size; 2401 2401 char *data;
