Deleted Added
full compact
kern_malloc.c (43012) kern_malloc.c (43301)
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.52 1999/01/21 08:29:04 dillon Exp $
34 * $Id: kern_malloc.c,v 1.53 1999/01/21 21:54:32 msmith Exp $
35 */
36
37#include "opt_vm.h"
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>
42#define MALLOC_INSTANTIATE

--- 79 unchanged lines hidden (view full) ---

122 register struct kmemusage *kup;
123 register struct freelist *freep;
124 long indx, npg, allocsize;
125 int s;
126 caddr_t va, cp, savedlist;
127#ifdef INVARIANTS
128 long *end, *lp;
129 int copysize;
35 */
36
37#include "opt_vm.h"
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/kernel.h>
42#define MALLOC_INSTANTIATE

--- 79 unchanged lines hidden (view full) ---

122 register struct kmemusage *kup;
123 register struct freelist *freep;
124 long indx, npg, allocsize;
125 int s;
126 caddr_t va, cp, savedlist;
127#ifdef INVARIANTS
128 long *end, *lp;
129 int copysize;
130 char *savedtype;
130 const char *savedtype;
131#endif
132 register struct malloc_type *ksp = type;
133
134 /*
135 * Must be at splmem() prior to initializing segment to handle
136 * potential initialization race.
137 */
138

--- 75 unchanged lines hidden (view full) ---

214 freep->next = savedlist;
215 if (kbp->kb_last == NULL)
216 kbp->kb_last = (caddr_t)freep;
217 }
218 va = kbp->kb_next;
219 kbp->kb_next = ((struct freelist *)va)->next;
220#ifdef INVARIANTS
221 freep = (struct freelist *)va;
131#endif
132 register struct malloc_type *ksp = type;
133
134 /*
135 * Must be at splmem() prior to initializing segment to handle
136 * potential initialization race.
137 */
138

--- 75 unchanged lines hidden (view full) ---

214 freep->next = savedlist;
215 if (kbp->kb_last == NULL)
216 kbp->kb_last = (caddr_t)freep;
217 }
218 va = kbp->kb_next;
219 kbp->kb_next = ((struct freelist *)va)->next;
220#ifdef INVARIANTS
221 freep = (struct freelist *)va;
222 savedtype = (char *) type->ks_shortdesc;
222 savedtype = (const char *) type->ks_shortdesc;
223#if BYTE_ORDER == BIG_ENDIAN
224 freep->type = (struct malloc_type *)WEIRD_ADDR >> 16;
225#endif
226#if BYTE_ORDER == LITTLE_ENDIAN
227 freep->type = (struct malloc_type *)WEIRD_ADDR;
228#endif
229 if ((intptr_t)(void *)&freep->next & 0x2)
230 freep->next = (caddr_t)((WEIRD_ADDR >> 16)|(WEIRD_ADDR << 16));

--- 276 unchanged lines hidden ---
223#if BYTE_ORDER == BIG_ENDIAN
224 freep->type = (struct malloc_type *)WEIRD_ADDR >> 16;
225#endif
226#if BYTE_ORDER == LITTLE_ENDIAN
227 freep->type = (struct malloc_type *)WEIRD_ADDR;
228#endif
229 if ((intptr_t)(void *)&freep->next & 0x2)
230 freep->next = (caddr_t)((WEIRD_ADDR >> 16)|(WEIRD_ADDR << 16));

--- 276 unchanged lines hidden ---