]>
git.saurik.com Git - apple/xnu.git/blob - libkern/libkern/OSMalloc.h
8f87701753a8eefc67475066c9cc2b6e17c39889
2 * Copyright (c) 2003-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef LIBKERN_OSMALLOC_h
25 #define LIBKERN_OSMALLOC_h
27 #include <sys/cdefs.h>
32 #ifdef MACH_KERNEL_PRIVATE
33 #include <kern/queue.h>
36 #ifdef MACH_KERNEL_PRIVATE
38 #define OSMT_MAX_NAME 64
40 typedef struct _OSMallocTag_
{
41 queue_chain_t OSMT_link
;
45 char OSMT_name
[OSMT_MAX_NAME
];
48 #define OSMT_VALID_MASK 0xFFFF0000
49 #define OSMT_VALID 0xDEAB0000
50 #define OSMT_RELEASED 0x00000001
52 #define OSMT_ATTR_PAGEABLE 0x01
54 typedef struct __OSMallocTag__
*OSMallocTag
, *OSMallocTag_t
;
57 #define OSMT_DEFAULT 0x00
58 #define OSMT_PAGEABLE 0x01
60 extern OSMallocTag
OSMalloc_Tagalloc(const char * str
, uint32_t flags
);
62 extern void OSMalloc_Tagfree(OSMallocTag tag
);
64 extern void * OSMalloc(uint32_t size
, OSMallocTag tag
);
66 extern void * OSMalloc_nowait(uint32_t size
, OSMallocTag tag
);
68 extern void * OSMalloc_noblock(uint32_t size
, OSMallocTag tag
);
70 extern void OSFree(void * addr
, uint32_t size
, OSMallocTag tag
);
74 #endif /* LIBKERN_OSMALLOC_h */