Re: mremap() proposal (was Re: malloc and joe)

Wolfram Gloger (Wolfram.Gloger@dent.med.uni-muenchen.de)
Sat, 23 Mar 1996 18:06:34 +0100


> Ok, here is a draft implementation of the "mremap()" system call, Wolfram could
> you test?

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;
}