diff options
author | 2001-12-05 17:49:06 +0000 | |
---|---|---|
committer | 2001-12-05 17:49:06 +0000 | |
commit | 8182ffb21e74f57bdd201c0786761aeb68e5f934 (patch) | |
tree | a5a195eac71a0a5c4e3321ded24a94a99f407e52 /sys/kern/kern_malloc.c | |
parent | Correctly parse hex numbers. Spotted by Claudio Jeker. Closes PR 2234. (diff) | |
download | wireguard-openbsd-8182ffb21e74f57bdd201c0786761aeb68e5f934.tar.xz wireguard-openbsd-8182ffb21e74f57bdd201c0786761aeb68e5f934.zip |
If we assume (just pure speculation) that there will be a pmap sometime in
the future that wants to allocate pv entries for every pmap_enter and wants
to allocate those pv entries from kmem_map, it might be a good idea to
init the kmem_map before initializing the kmemusage struct (because kmemusage
allocates memory).
Diffstat (limited to 'sys/kern/kern_malloc.c')
-rw-r--r-- | sys/kern/kern_malloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 60409bb69b5..aee61ff48d6 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_malloc.c,v 1.43 2001/12/05 01:57:15 provos Exp $ */ +/* $OpenBSD: kern_malloc.c,v 1.44 2001/12/05 17:49:06 art Exp $ */ /* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */ /* @@ -490,11 +490,11 @@ kmeminit() */ kmeminit_nkmempages(); - kmemusage = (struct kmemusage *) uvm_km_zalloc(kernel_map, - (vsize_t)(nkmempages * sizeof(struct kmemusage))); kmem_map = uvm_km_suballoc(kernel_map, (vaddr_t *)&kmembase, (vaddr_t *)&kmemlimit, (vsize_t)(nkmempages * PAGE_SIZE), VM_MAP_INTRSAFE, FALSE, &kmem_map_store); + kmemusage = (struct kmemusage *) uvm_km_zalloc(kernel_map, + (vsize_t)(nkmempages * sizeof(struct kmemusage))); #ifdef KMEMSTATS for (indx = 0; indx < MINBUCKET + 16; indx++) { if (1 << indx >= PAGE_SIZE) |