OLD | NEW |
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 #ifndef PLARENAS_H | 6 #ifndef PLARENAS_H |
7 #define PLARENAS_H | 7 #define PLARENAS_H |
8 | 8 |
9 PR_BEGIN_EXTERN_C | 9 PR_BEGIN_EXTERN_C |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 PR_EXTERN(void) PL_FinishArenaPool(PLArenaPool *pool); | 40 PR_EXTERN(void) PL_FinishArenaPool(PLArenaPool *pool); |
41 | 41 |
42 /* | 42 /* |
43 ** Compact all of the arenas in a pool so that no space is wasted. | 43 ** Compact all of the arenas in a pool so that no space is wasted. |
44 ** NOT IMPLEMENTED. Do not use. | 44 ** NOT IMPLEMENTED. Do not use. |
45 **/ | 45 **/ |
46 PR_EXTERN(void) PL_CompactArenaPool(PLArenaPool *pool); | 46 PR_EXTERN(void) PL_CompactArenaPool(PLArenaPool *pool); |
47 | 47 |
48 /* | 48 /* |
49 ** Friend functions used by the PL_ARENA_*() macros. | 49 ** Friend functions used by the PL_ARENA_*() macros. |
| 50 ** |
| 51 ** WARNING: do not call these functions directly. Always use the |
| 52 ** PL_ARENA_*() macros. |
50 **/ | 53 **/ |
51 PR_EXTERN(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb); | 54 PR_EXTERN(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb); |
52 | 55 |
53 PR_EXTERN(void *) PL_ArenaGrow( | 56 PR_EXTERN(void *) PL_ArenaGrow( |
54 PLArenaPool *pool, void *p, PRUint32 size, PRUint32 incr); | 57 PLArenaPool *pool, void *p, PRUint32 size, PRUint32 incr); |
55 | 58 |
56 PR_EXTERN(void) PL_ArenaRelease(PLArenaPool *pool, char *mark); | 59 PR_EXTERN(void) PL_ArenaRelease(PLArenaPool *pool, char *mark); |
57 | 60 |
58 /* | 61 /* |
59 ** memset contents of all arenas in pool to pattern | 62 ** memset contents of all arenas in pool to pattern |
60 */ | 63 */ |
61 PR_EXTERN(void) PL_ClearArenaPool(PLArenaPool *pool, PRInt32 pattern); | 64 PR_EXTERN(void) PL_ClearArenaPool(PLArenaPool *pool, PRInt32 pattern); |
62 | 65 |
| 66 /* |
| 67 ** A function like malloc_size() or malloc_usable_size() that measures the |
| 68 ** size of a heap block. |
| 69 */ |
| 70 typedef size_t (*PLMallocSizeFn)(const void *ptr); |
| 71 |
| 72 /* |
| 73 ** Measure all memory used by a PLArenaPool, excluding the PLArenaPool |
| 74 ** structure. |
| 75 */ |
| 76 PR_EXTERN(size_t) PL_SizeOfArenaPoolExcludingPool( |
| 77 const PLArenaPool *pool, PLMallocSizeFn mallocSizeOf); |
| 78 |
63 PR_END_EXTERN_C | 79 PR_END_EXTERN_C |
64 | 80 |
65 #endif /* PLARENAS_H */ | 81 #endif /* PLARENAS_H */ |
OLD | NEW |