[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nfree patch (memory fragmentation...)



i just had it again, some memory chunk left in the middle of nowhere...
looked again at the 1.09 diffs, hit ctrl-shift-alt-f5:

pid   4 (ksh): Arena at 1122A4 size 6000: free list:
pid   4 (ksh):       112DC4 size        0
pid   4 (ksh):       112E18 size        0
pid   4 (ksh):       1133CA size        4
pid   4 (ksh):       113468 size        8
...
pid   4 (ksh): Arena at 1AC988 size 4000: free list:
pid   4 (ksh):       1AC994 size     3FEC

 strange, a 4000 long area with 3fec free...  here's a patch :-)

--- nalloc2.c_	Tue Aug 17 18:36:30 1993
+++ nalloc2.c	Thu Aug 19 21:46:12 1993
@@ -239,7 +239,8 @@
 
     /* if, after coalescing, this arena is entirely free, Mfree it! */
     if ((struct arena *)a->a_ffirst == a+1 && 
-        (a->a_ffirst->b_size + sizeof(struct block)) == a->a_size) {
+        (a->a_ffirst->b_size + sizeof(struct block) + sizeof(struct arena))
+		== a->a_size && a != a_first) {
 	    NALLOC_DEBUG('!');
 	    *qa = a->a_next;
 #if 1

 btw i later also found what looked like kmalloc'd pathnames of
nonexisting files that the shell must have searched earlier...  is
it tosfs that keeps them?  why? :-)

 cheers
	Juergen
-- 
J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
								...ohne Gewehr
PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA