1/*-
2 * Copyright (c) 2002, 2003, 2004, 2005 Jeffrey Roberson <jeff@FreeBSD.org>
3 * Copyright (c) 2004, 2005 Bosko Milekic <bmilekic@FreeBSD.org>
4 * Copyright (c) 2004-2006 Robert N. M. Watson
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
--- 34 unchanged lines hidden (view full) ---
43
44/*
45 * TODO:
46 * - Improve memory usage for large allocations
47 * - Investigate cache size adjustments
48 */
49
50#include <sys/cdefs.h>
51__FBSDID("$FreeBSD: head/sys/vm/uma_core.c 166213 2007-01-25 01:05:23Z mohans $");
52
53/* I should really use ktr.. */
54/*
55#define UMA_DEBUG 1
56#define UMA_DEBUG_ALLOC 1
57#define UMA_DEBUG_ALLOC_1 1
58*/
59
--- 46 unchanged lines hidden (view full) ---
106static uma_zone_t slabrefzone; /* With refcounters (for UMA_ZONE_REFCNT) */
107
108/*
109 * The initial hash tables come out of this zone so they can be allocated
110 * prior to malloc coming up.
111 */
112static uma_zone_t hashzone;
113
114static MALLOC_DEFINE(M_UMAHASH, "UMAHash", "UMA Hash Buckets");
115
116/*
117 * Are we allowed to allocate buckets?
118 */
119static int bucketdisable = 1;
120
121/* Linked list of all kegs in the system */
--- 1580 unchanged lines hidden (view full) ---
1702uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini,
1703 int align, u_int32_t flags)
1704{
1705 struct uma_kctor_args args;
1706
1707 args.size = size;
1708 args.uminit = uminit;
1709 args.fini = fini;
1710 args.align = align;
1711 args.flags = flags;
1712 args.zone = zone;
1713 return (uma_zalloc_internal(kegs, &args, M_WAITOK));
1714}
1715
1716/* See uma.h */
1717uma_zone_t
1718uma_zcreate(char *name, size_t size, uma_ctor ctor, uma_dtor dtor,
1719 uma_init uminit, uma_fini fini, int align, u_int32_t flags)
1720
1721{
1722 struct uma_zctor_args args;
1723
1724 /* This stuff is essential for the zone ctor */
--- 1277 unchanged lines hidden ---
2 * Copyright (c) 2002, 2003, 2004, 2005 Jeffrey Roberson <jeff@FreeBSD.org>
3 * Copyright (c) 2004, 2005 Bosko Milekic <bmilekic@FreeBSD.org>
4 * Copyright (c) 2004-2006 Robert N. M. Watson
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
--- 34 unchanged lines hidden (view full) ---
43
44/*
45 * TODO:
46 * - Improve memory usage for large allocations
47 * - Investigate cache size adjustments
48 */
49
50#include <sys/cdefs.h>
51__FBSDID("$FreeBSD: head/sys/vm/uma_core.c 166213 2007-01-25 01:05:23Z mohans $");
52
53/* I should really use ktr.. */
54/*
55#define UMA_DEBUG 1
56#define UMA_DEBUG_ALLOC 1
57#define UMA_DEBUG_ALLOC_1 1
58*/
59
--- 46 unchanged lines hidden (view full) ---
106static uma_zone_t slabrefzone; /* With refcounters (for UMA_ZONE_REFCNT) */
107
108/*
109 * The initial hash tables come out of this zone so they can be allocated
110 * prior to malloc coming up.
111 */
112static uma_zone_t hashzone;
113
114static MALLOC_DEFINE(M_UMAHASH, "UMAHash", "UMA Hash Buckets");
115
116/*
117 * Are we allowed to allocate buckets?
118 */
119static int bucketdisable = 1;
120
121/* Linked list of all kegs in the system */
--- 1580 unchanged lines hidden (view full) ---
1702uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini,
1703 int align, u_int32_t flags)
1704{
1705 struct uma_kctor_args args;
1706
1707 args.size = size;
1708 args.uminit = uminit;
1709 args.fini = fini;
1710 args.align = align;
1711 args.flags = flags;
1712 args.zone = zone;
1713 return (uma_zalloc_internal(kegs, &args, M_WAITOK));
1714}
1715
1716/* See uma.h */
1717uma_zone_t
1718uma_zcreate(char *name, size_t size, uma_ctor ctor, uma_dtor dtor,
1719 uma_init uminit, uma_fini fini, int align, u_int32_t flags)
1720
1721{
1722 struct uma_zctor_args args;
1723
1724 /* This stuff is essential for the zone ctor */
--- 1277 unchanged lines hidden ---