Changeset 1925 for trunk/src/kmk/misc.c
- Timestamp:
- Oct 24, 2008, 5:32:21 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/misc.c
r1918 r1925 1224 1224 cache->free_head = NULL; 1225 1225 cache->size = act_size; 1226 cache->total_count = 0; 1226 1227 cache->alloc_count = 0; 1227 cache-> total_count= 0;1228 cache->free_count = 0; 1228 1229 cache->name = name; 1229 1230 cache->grow_arg = grow_arg; … … 1257 1258 if (eat->free_head) 1258 1259 { 1260 unsigned int eat_in_use = eat->alloc_count - eat->free_count; 1261 unsigned int dst_in_use = cache->alloc_count - cache->free_count; 1259 1262 if (!cache->free_head) 1260 1263 cache->free_head = eat->free_head; 1261 else if (eat->total_count - eat ->alloc_count < cache->total_count - cache->alloc_count)1264 else if (eat->total_count - eat_in_use < cache->total_count - dst_ins_use) 1262 1265 { 1263 1266 struct alloccache_free_ent *last = eat->free_head; … … 1287 1290 /* and statistics */ 1288 1291 cache->alloc_count += eat->alloc_count; 1289 cache-> total_count += eat->total_count;1292 cache->free_count += eat->free_count; 1290 1293 #else 1291 1294 /* and statistics */ 1292 1295 cache->alloc_count += eat->alloc_count; 1293 cache->total_count += eat->alloc_count; 1294 #endif 1296 cache->free_count += eat->free_count; 1297 #endif 1298 cache->total_count += eat->total_count; 1295 1299 1296 1300 /* unlink and disable the eat cache */ … … 1316 1320 { 1317 1321 printf (_("\n# Alloc Cache: %s\n" 1318 "# Items: size = %-3u in-use = %-6d total = %-6u\n"), 1319 cache->name, cache->size, (int)cache->alloc_count, cache->total_count); 1322 "# Items: size = %-3u total = %-6u"), 1323 cache->name, cache->size, cache->total_count); 1324 MAKE_STATS(printf (_(" in-use = %-6lu"), 1325 cache->alloc_count - cache->free_count);); 1326 MAKE_STATS(printf (_("\n# alloc calls = %-7lu free calls = %-7lu"), 1327 cache->alloc_count, cache->free_count);); 1328 printf ("\n"); 1320 1329 } 1321 1330
Note:
See TracChangeset
for help on using the changeset viewer.