Changeset 1211
- Timestamp:
- 01/27/08 13:45:08 (10 months ago)
- Files:
-
- 1.8.3/branches/devel/hdrs/intmap.h (modified) (1 diff)
- 1.8.3/branches/devel/src/cque.c (modified) (2 diffs)
- 1.8.3/branches/devel/src/game.c (modified) (3 diffs)
- 1.8.3/branches/devel/src/intmap.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/branches/devel/hdrs/intmap.h
r1208 r1211 21 21 bool im_delete(intmap*, uint32_t); 22 22 void im_dump_graph(intmap*, const char *); 23 23 void im_stats_header(dbref); 24 void im_stats(dbref, intmap*, const char *); 24 25 #endif /* INTMAP_H */ 1.8.3/branches/devel/src/cque.c
r1209 r1211 69 69 slab *bque_slab = NULL; /**< slab for 'struct bque' allocations */ 70 70 71 staticintmap *queue_map = NULL; /**< Intmap for looking up queue entries by pid */71 intmap *queue_map = NULL; /**< Intmap for looking up queue entries by pid */ 72 72 static uint32_t top_pid = 0; 73 #define MAX_PID (1U << 15) 73 74 74 75 static BQUE *qfirst = NULL, *qlast = NULL, *qwait = NULL; … … 265 266 266 267 while (1) { 267 if (pid > (1U << 16))268 if (pid > MAX_PID) 268 269 pid = 0; 269 270 if (im_exists(queue_map, pid)) 1.8.3/branches/devel/src/game.c
r1143 r1211 61 61 #include "htab.h" 62 62 #include "ptab.h" 63 #include "intmap.h" 63 64 #include "log.h" 64 65 #include "lock.h" … … 2341 2342 extern PTAB ptab_attrib; 2342 2343 extern PTAB ptab_flag; 2344 extern intmap *queue_map, *descs_by_fd; 2343 2345 2344 2346 /** Reports stats on various in-memory data structures. … … 2369 2371 st_stats(player, &object_names, "ObjNames"); 2370 2372 st_stats(player, &lock_names, "LockNames"); 2373 notify(player, "Integer Maps:"); 2374 im_stats_header(player); 2375 im_stats(player, queue_map, "Queue IDs"); 2376 im_stats(player, descs_by_fd, "Connections"); 2377 2371 2378 #if (COMPRESSION_TYPE >= 3) && defined(COMP_STATS) 2372 2379 if (Wizard(player)) { 1.8.3/branches/devel/src/intmap.c
r1210 r1211 22 22 * 23 23 * There are various properties of patricia trees that aren't used at 24 * all in this (Like finding all keys that have a particular prefix). 24 * all in this (Like finding all keys that have a particular 25 * prefix). However, consider using them in a rewrite of the prefix 26 * table code... 25 27 * 26 28 * Normally patricia trees use the leftmost bit as position 0. I've … … 458 460 fclose(fp); 459 461 } 462 463 /** Header line for @stats/tables for intmaps */ 464 void 465 im_stats_header(dbref player) 466 { 467 notify(player, "Map Entries ~Memory"); 468 } 469 470 /** @stats/tables line */ 471 void 472 im_stats(dbref player, intmap *im, const char *name) 473 { 474 notify_format(player, "%-11s %7d %7u", name, im->count, 475 (unsigned int)(sizeof(*im) + (sizeof(patricia) * im->count))); 476 }
