]>
git.saurik.com Git - apple/xnu.git/blob - libkern/libkern/OSMalloc.h
c54b90070f0d882099c60690709393f59b85155c
2 * Copyright (c) 2003-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 #ifndef LIBKERN_OSMALLOC_h
30 #define LIBKERN_OSMALLOC_h
32 #include <sys/cdefs.h>
37 #ifdef MACH_KERNEL_PRIVATE
38 #include <kern/queue.h>
41 #ifdef MACH_KERNEL_PRIVATE
43 #define OSMT_MAX_NAME 64
45 typedef struct _OSMallocTag_
{
46 queue_chain_t OSMT_link
;
50 char OSMT_name
[OSMT_MAX_NAME
];
53 #define OSMT_VALID_MASK 0xFFFF0000
54 #define OSMT_VALID 0xDEAB0000
55 #define OSMT_RELEASED 0x00000001
57 #define OSMT_ATTR_PAGEABLE 0x01
59 typedef struct __OSMallocTag__
*OSMallocTag
, *OSMallocTag_t
;
62 #define OSMT_DEFAULT 0x00
63 #define OSMT_PAGEABLE 0x01
65 extern OSMallocTag
OSMalloc_Tagalloc(const char * str
, uint32_t flags
);
67 extern void OSMalloc_Tagfree(OSMallocTag tag
);
69 extern void * OSMalloc(uint32_t size
, OSMallocTag tag
);
71 extern void * OSMalloc_nowait(uint32_t size
, OSMallocTag tag
);
73 extern void * OSMalloc_noblock(uint32_t size
, OSMallocTag tag
);
75 extern void OSFree(void * addr
, uint32_t size
, OSMallocTag tag
);
79 #endif /* LIBKERN_OSMALLOC_h */