This seems to work very well, with the appended typo-fix (to clarify,
it's against 1.3.77, already patched with Linus' p78.gz). Thanks a
lot !
I'll post a patch on the linux-gcc list for Doug Lea's malloc-2.6.2.c
(which is in libc-5.3.x) which makes realloc() use mremap() for large
mmapped chunks.
Now, I wish I could mail SGI support `Look, I'd like this new system
call mremap()..' and get an answer 12 hours later `OK, please try
this patch..' Oops, must have been dreaming. [Please insert your
workstation vendor for `SGI'.]
Regards,
Wolfram.
--- mremap.c.orig Sat Mar 23 12:58:08 1996
+++ mremap.c Sat Mar 23 16:02:00 1996
@@ -173,7 +173,7 @@
* the unnecessary pages..
*/
if (old_len > new_len) {
- do_munmap(addr+old_len, old_len - new_len);
+ do_munmap(addr+new_len, old_len - new_len);
return addr;
}