... | ... |
@@ -9,7 +9,7 @@ |
9 | 9 |
VERSION = 0 |
10 | 10 |
PATCHLEVEL = 8 |
11 | 11 |
SUBLEVEL = 6 |
12 |
-EXTRAVERSION = -3 |
|
12 |
+EXTRAVERSION = -4 |
|
13 | 13 |
|
14 | 14 |
RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
15 | 15 |
OS = $(shell uname -s) |
... | ... |
@@ -101,7 +101,7 @@ ifeq ($(mode), release) |
101 | 101 |
#-Wmissing-prototypes \ |
102 | 102 |
|
103 | 103 |
ifneq (,$(findstring 3.0, $(CC_VER))) |
104 |
- CFLAGS=-minline-all-stringops -malign-double \ |
|
104 |
+ CFLAGS+=-minline-all-stringops -malign-double \ |
|
105 | 105 |
-march=athlon \ |
106 | 106 |
#-mcpu=athlon |
107 | 107 |
endif |
... | ... |
@@ -67,7 +67,7 @@ inline static void release_lock(fl_lock_t* lock) |
67 | 67 |
asm volatile( |
68 | 68 |
" movb $0, (%0)" : /*no output*/ : "r"(lock): "memory" |
69 | 69 |
/*" xchg %b0, %1" : "=q" (val), "=m" (*lock) : "0" (val) : "memory"*/ |
70 |
- ); /* hmm, maybe lock; movb $0, [%1] would be faster ???*/ |
|
70 |
+ ); |
|
71 | 71 |
#elif defined __sparc |
72 | 72 |
asm volatile( |
73 | 73 |
"membar #LoadStore | #StoreStore \n\t" /*is this really needed?*/ |
... | ... |
@@ -26,6 +26,11 @@ |
26 | 26 |
F_MALLOC_OPTIMIZE/ROUNDTO+big_hash_idx((s))- \ |
27 | 27 |
F_MALLOC_OPTIMIZE_FACTOR+1 ) |
28 | 28 |
|
29 |
+#define UN_HASH(h) ( ((h)<(F_MALLOC_OPTIMIZE/ROUNDTO))?(h)*ROUNDTO: \ |
|
30 |
+ 1<<((h)-F_MALLOC_OPTIMIZE/ROUNDTO+\ |
|
31 |
+ F_MALLOC_OPTIMIZE_FACTOR-1)\ |
|
32 |
+ ) |
|
33 |
+ |
|
29 | 34 |
|
30 | 35 |
/* computes hash number for big buckets*/ |
31 | 36 |
inline static int big_hash_idx(int s) |
... | ... |
@@ -247,6 +252,7 @@ void fm_status(struct fm_block* qm) |
247 | 252 |
struct fm_frag* f; |
248 | 253 |
int i,j; |
249 | 254 |
int h; |
255 |
+ int size; |
|
250 | 256 |
|
251 | 257 |
LOG(L_INFO, "fm_status (%x):\n", qm); |
252 | 258 |
if (!qm) return; |
... | ... |
@@ -271,10 +277,15 @@ void fm_status(struct fm_block* qm) |
271 | 277 |
} |
272 | 278 |
*/ |
273 | 279 |
LOG(L_INFO, "dumping free list:\n"); |
274 |
- for(h=0,i=0;h<F_HASH_SIZE;h++){ |
|
280 |
+ for(h=0,i=0,size=0;h<F_HASH_SIZE;h++){ |
|
275 | 281 |
|
276 |
- for (f=qm->free_hash[h],j=0; f; f=f->u.nxt_free, i++, j++) |
|
277 |
- if (j) LOG(L_INFO, "hash= %3d. fragments no.: %5d\n", h, j); |
|
282 |
+ for (f=qm->free_hash[h],j=0; f; size+=f->size,f=f->u.nxt_free,i++,j++); |
|
283 |
+ if (j) LOG(L_INFO, "hash = %3d fragments no.: %5d,\n\t\t" |
|
284 |
+ " bucket size: %9d - %9d (first %9d)\n", |
|
285 |
+ h, j, UN_HASH(h), |
|
286 |
+ ((h<F_MALLOC_OPTIMIZE/ROUNDTO)?1:2)*UN_HASH(h), |
|
287 |
+ qm->free_hash[h]->size |
|
288 |
+ ); |
|
278 | 289 |
/* |
279 | 290 |
{ |
280 | 291 |
LOG(L_INFO, " %5d.[%3d:%3d] %c address=%x size=%d(%x)\n", |
... | ... |
@@ -288,7 +299,7 @@ void fm_status(struct fm_block* qm) |
288 | 299 |
} |
289 | 300 |
*/ |
290 | 301 |
} |
291 |
- LOG(L_INFO, " Total: %6d fragments\n", i); |
|
302 |
+ LOG(L_INFO, "TOTAL: %6d free fragments = %6d free bytes\n", i, size); |
|
292 | 303 |
LOG(L_INFO, "-----------------------------\n"); |
293 | 304 |
} |
294 | 305 |
|