]>
git.saurik.com Git - apple/xnu.git/blob - libkern/libkern/OSMalloc.h
0390a77033f7a8f537165a832abe2c2631320401
2 * Copyright (c) 2003-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 #ifndef LIBKERN_OSMALLOC_h
24 #define LIBKERN_OSMALLOC_h
26 #include <sys/cdefs.h>
31 #ifdef MACH_KERNEL_PRIVATE
32 #include <kern/queue.h>
35 #ifdef MACH_KERNEL_PRIVATE
37 #define OSMT_MAX_NAME 64
39 typedef struct _OSMallocTag_
{
40 queue_chain_t OSMT_link
;
44 char OSMT_name
[OSMT_MAX_NAME
];
47 #define OSMT_VALID_MASK 0xFFFF0000
48 #define OSMT_VALID 0xDEAB0000
49 #define OSMT_RELEASED 0x00000001
51 #define OSMT_ATTR_PAGEABLE 0x01
53 typedef struct __OSMallocTag__
*OSMallocTag
, *OSMallocTag_t
;
56 #define OSMT_DEFAULT 0x00
57 #define OSMT_PAGEABLE 0x01
59 extern OSMallocTag
OSMalloc_Tagalloc(const char * str
, uint32_t flags
);
61 extern void OSMalloc_Tagfree(OSMallocTag tag
);
63 extern void * OSMalloc(uint32_t size
, OSMallocTag tag
);
65 extern void * OSMalloc_nowait(uint32_t size
, OSMallocTag tag
);
67 extern void * OSMalloc_noblock(uint32_t size
, OSMallocTag tag
);
69 extern void OSFree(void * addr
, uint32_t size
, OSMallocTag tag
);
73 #endif /* LIBKERN_OSMALLOC_h */