OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include <cstddef> | 25 #include <cstddef> |
26 | 26 |
27 namespace WTF { | 27 namespace WTF { |
28 | 28 |
29 // These functions crash safely if an allocation fails. | 29 // These functions crash safely if an allocation fails. |
30 WTF_EXPORT void* fastMalloc(size_t); | 30 WTF_EXPORT void* fastMalloc(size_t); |
31 WTF_EXPORT void* fastZeroedMalloc(size_t); | 31 WTF_EXPORT void* fastZeroedMalloc(size_t); |
32 WTF_EXPORT void* fastCalloc(size_t numElements, size_t elementSize); | 32 WTF_EXPORT void* fastCalloc(size_t numElements, size_t elementSize); |
33 WTF_EXPORT void* fastRealloc(void*, size_t); | 33 WTF_EXPORT void* fastRealloc(void*, size_t); |
34 WTF_EXPORT char* fastStrDup(const char*); | 34 WTF_EXPORT char* fastStrDup(const char*); |
| 35 WTF_EXPORT size_t fastMallocGoodSize(size_t); |
35 | 36 |
36 WTF_EXPORT void fastFree(void*); | 37 WTF_EXPORT void fastFree(void*); |
37 | 38 |
38 #ifndef NDEBUG | 39 #ifndef NDEBUG |
39 WTF_EXPORT void fastMallocForbid(); | 40 WTF_EXPORT void fastMallocForbid(); |
40 WTF_EXPORT void fastMallocAllow(); | 41 WTF_EXPORT void fastMallocAllow(); |
41 #endif | 42 #endif |
42 | 43 |
43 WTF_EXPORT void releaseFastMallocFreeMemory(); | 44 WTF_EXPORT void releaseFastMallocFreeMemory(); |
44 | 45 |
45 struct FastMallocStatistics { | 46 struct FastMallocStatistics { |
46 size_t reservedVMBytes; | 47 size_t reservedVMBytes; |
47 size_t committedVMBytes; | 48 size_t committedVMBytes; |
48 size_t freeListBytes; | 49 size_t freeListBytes; |
49 }; | 50 }; |
50 WTF_EXPORT FastMallocStatistics fastMallocStatistics(); | 51 WTF_EXPORT FastMallocStatistics fastMallocStatistics(); |
51 | 52 |
52 // This defines a type which holds an unsigned integer and is the same | 53 // This defines a type which holds an unsigned integer and is the same |
53 // size as the minimally aligned memory allocation. | 54 // size as the minimally aligned memory allocation. |
54 typedef unsigned long long AllocAlignmentInteger; | 55 typedef unsigned long long AllocAlignmentInteger; |
55 | 56 |
56 } // namespace WTF | 57 } // namespace WTF |
57 | 58 |
58 using WTF::fastCalloc; | 59 using WTF::fastCalloc; |
59 using WTF::fastFree; | 60 using WTF::fastFree; |
60 using WTF::fastMalloc; | 61 using WTF::fastMalloc; |
| 62 using WTF::fastMallocGoodSize; |
61 using WTF::fastRealloc; | 63 using WTF::fastRealloc; |
62 using WTF::fastStrDup; | 64 using WTF::fastStrDup; |
63 using WTF::fastZeroedMalloc; | 65 using WTF::fastZeroedMalloc; |
64 | 66 |
65 #ifndef NDEBUG | 67 #ifndef NDEBUG |
66 using WTF::fastMallocForbid; | 68 using WTF::fastMallocForbid; |
67 using WTF::fastMallocAllow; | 69 using WTF::fastMallocAllow; |
68 #endif | 70 #endif |
69 | 71 |
70 #endif /* WTF_FastMalloc_h */ | 72 #endif /* WTF_FastMalloc_h */ |
OLD | NEW |