kern_malloc.c (8876) | kern_malloc.c (10358) |
---|---|
1/* 2 * Copyright (c) 1987, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94 | 1/* 2 * Copyright (c) 1987, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)kern_malloc.c 8.3 (Berkeley) 1/4/94 |
34 * $Id: kern_malloc.c,v 1.11 1995/04/16 11:25:15 davidg Exp $ | 34 * $Id: kern_malloc.c,v 1.12 1995/05/30 08:05:33 rgrimes Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/proc.h> 40#include <sys/kernel.h> 41#include <sys/malloc.h> 42 43#include <vm/vm.h> 44#include <vm/vm_kern.h> 45 | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/proc.h> 40#include <sys/kernel.h> 41#include <sys/malloc.h> 42 43#include <vm/vm.h> 44#include <vm/vm_kern.h> 45 |
46/* 47 * System initialization 48 */ 49 50static void kmeminit __P((caddr_t)); 51SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL) 52 53 |
|
46struct kmembuckets bucket[MINBUCKET + 16]; 47struct kmemstats kmemstats[M_LAST]; 48struct kmemusage *kmemusage; 49char *kmembase, *kmemlimit; 50char *memname[] = INITKMEMNAMES; 51 52#ifdef DIAGNOSTIC 53/* --- 297 unchanged lines hidden (view full) --- 351 freep->next = NULL; 352 kbp->kb_last = addr; 353 splx(s); 354} 355 356/* 357 * Initialize the kernel memory allocator 358 */ | 54struct kmembuckets bucket[MINBUCKET + 16]; 55struct kmemstats kmemstats[M_LAST]; 56struct kmemusage *kmemusage; 57char *kmembase, *kmemlimit; 58char *memname[] = INITKMEMNAMES; 59 60#ifdef DIAGNOSTIC 61/* --- 297 unchanged lines hidden (view full) --- 359 freep->next = NULL; 360 kbp->kb_last = addr; 361 splx(s); 362} 363 364/* 365 * Initialize the kernel memory allocator 366 */ |
359void 360kmeminit() | 367/* ARGSUSED*/ 368static void 369kmeminit( udata) 370caddr_t udata; /* not used*/ |
361{ 362 register long indx; 363 int npg; 364 365#if ((MAXALLOCSAVE & (MAXALLOCSAVE - 1)) != 0) 366 ERROR!_kmeminit:_MAXALLOCSAVE_not_power_of_2 367#endif 368#if (MAXALLOCSAVE > MINALLOCSIZE * 32768) --- 25 unchanged lines hidden --- | 371{ 372 register long indx; 373 int npg; 374 375#if ((MAXALLOCSAVE & (MAXALLOCSAVE - 1)) != 0) 376 ERROR!_kmeminit:_MAXALLOCSAVE_not_power_of_2 377#endif 378#if (MAXALLOCSAVE > MINALLOCSIZE * 32768) --- 25 unchanged lines hidden --- |