Changeset 6654 for trunk/ARBDB/arbdb.cxx
- Timestamp:
- 13/05/10 17:30:03 (2 years ago)
- Files:
-
- 1 modified
-
trunk/ARBDB/arbdb.cxx (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ARBDB/arbdb.cxx
r6648 r6654 285 285 }; 286 286 287 void GB_exit_gb() { 288 if (gb_local) { 289 gb_assert(gb_local->openedDBs == gb_local->closedDBs); 290 291 free(gb_local->bitcompress); 292 gb_free_compress_tree(gb_local->bituncompress); 293 free(gb_local->write_buffer); 294 295 free(check_out_buffer(&gb_local->buf2)); 296 free(check_out_buffer(&gb_local->buf1)); 297 298 gbm_free_mem((char*)gb_local, sizeof(*gb_local), 0); 299 gb_local = NULL; 300 301 gbm_flush_mem(); 302 } 303 } 304 287 305 void GB_init_gb() { 288 306 if (!gb_local) { 289 gb_local = (struct gb_local_data *)gbm_get_mem(sizeof(struct gb_local_data), 0); 307 GBK_install_SIGSEGV_handler(true); // never uninstalled 308 309 gbm_init_mem(); 310 311 gb_local = (gb_local_data *)gbm_get_mem(sizeof(gb_local_data), 0); 290 312 291 313 init_buffer(&gb_local->buf1, 4000); … … 300 322 gb_local->bitcompress = gb_build_compress_list(GB_BIT_compress_data, 1, &(gb_local->bc_size)); 301 323 324 gb_local->openedDBs = 0; 325 gb_local->closedDBs = 0; 326 302 327 #ifdef ARBDB_SIZEDEBUG 303 328 arbdb_stat = (long *)GB_calloc(sizeof(long), 1000); 304 329 #endif 330 331 atexit(GB_exit_gb); 305 332 } 306 333 } … … 969 996 { 970 997 char *d; 971 long memsize [2];998 long memsize; 972 999 973 1000 GB_TEST_WRITE(gbd, GB_BITS, "GB_write_bits"); … … 975 1002 gb_save_extern_data_in_ts(gbd); 976 1003 977 d = gb_compress_bits(bits, size, (const unsigned char *)c_0, memsize);1004 d = gb_compress_bits(bits, size, (const unsigned char *)c_0, &memsize); 978 1005 gbd->flags.compressed_data = 1; 979 GB_SETSMDMALLOC(gbd, size, memsize [0], d);1006 GB_SETSMDMALLOC(gbd, size, memsize, d); 980 1007 gb_touch_entry(gbd, GB_NORMAL_CHANGE); 981 1008 GB_DO_CALLBACKS(gbd); … … 2599 2626 2600 2627 GB_ERROR GB_print_debug_information(void */*dummy_AW_root*/, GBDATA *gb_main) { 2601 int i;2602 2628 GB_MAIN_TYPE *Main = GB_MAIN(gb_main); 2603 2629 GB_push_transaction(gb_main); 2604 for (i =0; i<Main->keycnt; i++) {2630 for (int i=0; i<Main->keycnt; i++) { 2605 2631 if (Main->keys[i].key) { 2606 2632 printf("%3i %20s nref %i\n", i, Main->keys[i].key, (int)Main->keys[i].nref); … … 2610 2636 } 2611 2637 } 2612 gbm_debug_mem( Main);2638 gbm_debug_mem(); 2613 2639 GB_pop_transaction(gb_main); 2614 2640 return 0;
