]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cryptkit/lib/falloc.h
Security-57337.20.44.tar.gz
[apple/security.git] / OSX / libsecurity_cryptkit / lib / falloc.h
1 /* Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved.
2 *
3 * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT
4 * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE
5 * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE, INC. AND THE
6 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE,
7 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
8 * EXPOSE YOU TO LIABILITY.
9 ***************************************************************************
10 *
11 * falloc.h - FEE malloc routines
12 *
13 * Revision History
14 * ----------------
15 * 20 Aug 96 at NeXT
16 * Created.
17 */
18
19 #ifndef _CK_FALLOC_H_
20 #define _CK_FALLOC_H_
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /*
27 * Clients can *optionally* register external memory alloc/free functions here.
28 */
29 typedef void *(mallocExternFcn)(unsigned size);
30 typedef void (freeExternFcn)(void *data);
31 typedef void *(reallocExternFcn)(void *oldData, unsigned newSize);
32 void fallocRegister(mallocExternFcn *mallocExtern,
33 freeExternFcn *freeExtern,
34 reallocExternFcn *reallocExtern);
35
36
37 void *fmalloc(unsigned size); /* general malloc */
38 void *fmallocWithData(const void *origData,
39 unsigned origDataLen); /* malloc, copy existing data */
40 void ffree(void *data); /* general free */
41 void *frealloc(void *oldPtr, unsigned newSize);
42
43 #ifdef __cplusplus
44 }
45 #endif
46
47 #endif /*_CK_FALLOC_H_*/