Deleted Added
full compact
kern_malloc.c (12662) kern_malloc.c (12819)
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.15 1995/12/02 17:10:34 bde Exp $
34 * $Id: kern_malloc.c,v 1.16 1995/12/07 12:46:44 davidg 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#include <sys/vmmeter.h>
43
44#include <vm/vm.h>
45#include <vm/vm_param.h>
46#include <vm/vm_kern.h>
47#include <vm/vm_extern.h>
48
49static void kmeminit __P((void *));
50SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL)
51
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#include <sys/vmmeter.h>
43
44#include <vm/vm.h>
45#include <vm/vm_param.h>
46#include <vm/vm_kern.h>
47#include <vm/vm_extern.h>
48
49static void kmeminit __P((void *));
50SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL)
51
52struct kmembuckets bucket[MINBUCKET + 16];
52static struct kmembuckets bucket[MINBUCKET + 16];
53struct kmemstats kmemstats[M_LAST];
54struct kmemusage *kmemusage;
55char *kmembase, *kmemlimit;
56char *memname[] = INITKMEMNAMES;
57
58#ifdef DIAGNOSTIC
59/*
60 * This structure provides a set of masks to catch unaligned frees.
61 */
53struct kmemstats kmemstats[M_LAST];
54struct kmemusage *kmemusage;
55char *kmembase, *kmemlimit;
56char *memname[] = INITKMEMNAMES;
57
58#ifdef DIAGNOSTIC
59/*
60 * This structure provides a set of masks to catch unaligned frees.
61 */
62long addrmask[] = { 0,
62static long addrmask[] = { 0,
63 0x00000001, 0x00000003, 0x00000007, 0x0000000f,
64 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff,
65 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff,
66 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff,
67};
68
69/*
70 * The WEIRD_ADDR is used as known text to copy into free objects so

--- 331 unchanged lines hidden ---
63 0x00000001, 0x00000003, 0x00000007, 0x0000000f,
64 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff,
65 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff,
66 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff,
67};
68
69/*
70 * The WEIRD_ADDR is used as known text to copy into free objects so

--- 331 unchanged lines hidden ---