aboutsummaryrefslogtreecommitdiffstats
path: root/zalloc.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2001-10-23 17:09:23 +0000
committerH. Peter Anvin <hpa@zytor.com>2001-10-23 17:09:23 +0000
commit0eca7bb7913aa0c6c642c1ea13a981ac89345de3 (patch)
tree0ae204355d632573a909635c2877648df4396493 /zalloc.c
parent18a1b3bf7b3974d264243377a2ea51c7656c4473 (diff)
downloadlpsm-0eca7bb7913aa0c6c642c1ea13a981ac89345de3.tar.gz
lpsm-0eca7bb7913aa0c6c642c1ea13a981ac89345de3.tar.xz
lpsm-0eca7bb7913aa0c6c642c1ea13a981ac89345de3.zip
Fix lpsm_zalloc(), and make debugging build work again.lpsm-0.1.6
Diffstat (limited to 'zalloc.c')
-rw-r--r--zalloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/zalloc.c b/zalloc.c
index f972b16..2faa623 100644
--- a/zalloc.c
+++ b/zalloc.c
@@ -37,7 +37,7 @@ void *lpsm_zalloc(size_t size)
while ( size > ((size_t)1 << order) )
order++;
- xbit = lpsm_malloc_buddy_xbit(size);
+ xbit = lpsm_malloc_buddy_xbit(order);
if ( !xbit ) {
errno = ENOMEM;
return NULL;
@@ -53,7 +53,7 @@ void *lpsm_zalloc(size_t size)
size = (size_t)1 << order; /* "Real" size */
/* Do an anonymous mmap() over the affected area */
mv = mmap(ptr, size, PROT_READ|PROT_WRITE,
- MAP_FIXED|MAP_PRIVATE, 0, 0);
+ MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
if ( mv != ptr ) {
memset(ptr, 0, size);
} else {