Subject: CVS commit: basesrc
To: None <source-changes@netbsd.org>
From: Christos Zoulas <christos@netbsd.org>
List: source-changes
Date: 05/06/2001 07:48:42
Module Name:	basesrc
Committed By:	christos
Date:		Sun May  6 04:48:42 UTC 2001

Modified Files:
	basesrc/lib/libc/stdlib: malloc.c

Log Message:
More fixes:

1. use uintptr_t instead of u_long
2. check for overflow in map_pages and malloc_pages
3. bring in fixes from FreeBSD [int -> size_t, and a missing THREAD_UNLOCK]
4. rewrite map_pages to use sbrk() only to grow memory (avoids extra syscall
   and elides bug in brk(2) that ross is fixing)
5. restore the break point to its original value if the mmap(2) for the page
   directory or the alignment sbrk breaks.

reviewed by: chuq and ross
tested by: make build and reboot
Now memtest nearly works; unfortunately there is no way currently to lower
the break point as we free, so memtest keeps trying to reduce memory when
mlock() fails and that does not work.


To generate a diff of this commit:
cvs rdiff -r1.37 -r1.38 basesrc/lib/libc/stdlib/malloc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.