Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: mozilla/nsprpub/lib/ds/plarenas.h

Issue 14249009: Change the NSS and NSPR source tree to the new directory structure to be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mozilla/nsprpub/lib/ds/plarena.c ('k') | mozilla/nsprpub/lib/ds/plhash.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
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/. */
5
6 #ifndef PLARENAS_H
7 #define PLARENAS_H
8
9 PR_BEGIN_EXTERN_C
10
11 typedef struct PLArenaPool PLArenaPool;
12
13 /*
14 ** Initialize an arena pool with the given name for debugging and metering,
15 ** with a minimum gross size per arena of size bytes. The net size per arena
16 ** is smaller than the gross size by a header of four pointers plus any
17 ** necessary padding for alignment.
18 **
19 ** Note: choose a gross size that's a power of two to avoid the heap allocator
20 ** rounding the size up.
21 **/
22 PR_EXTERN(void) PL_InitArenaPool(
23 PLArenaPool *pool, const char *name, PRUint32 size, PRUint32 align);
24
25 /*
26 ** Finish using arenas, freeing all memory associated with them.
27 **/
28 PR_EXTERN(void) PL_ArenaFinish(void);
29
30 /*
31 ** Free the arenas in pool. The user may continue to allocate from pool
32 ** after calling this function. There is no need to call PL_InitArenaPool()
33 ** again unless PL_FinishArenaPool(pool) has been called.
34 **/
35 PR_EXTERN(void) PL_FreeArenaPool(PLArenaPool *pool);
36
37 /*
38 ** Free the arenas in pool and finish using it altogether.
39 **/
40 PR_EXTERN(void) PL_FinishArenaPool(PLArenaPool *pool);
41
42 /*
43 ** Compact all of the arenas in a pool so that no space is wasted.
44 ** NOT IMPLEMENTED. Do not use.
45 **/
46 PR_EXTERN(void) PL_CompactArenaPool(PLArenaPool *pool);
47
48 /*
49 ** Friend functions used by the PL_ARENA_*() macros.
50 **/
51 PR_EXTERN(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb);
52
53 PR_EXTERN(void *) PL_ArenaGrow(
54 PLArenaPool *pool, void *p, PRUint32 size, PRUint32 incr);
55
56 PR_EXTERN(void) PL_ArenaRelease(PLArenaPool *pool, char *mark);
57
58 /*
59 ** memset contents of all arenas in pool to pattern
60 */
61 PR_EXTERN(void) PL_ClearArenaPool(PLArenaPool *pool, PRInt32 pattern);
62
63 PR_END_EXTERN_C
64
65 #endif /* PLARENAS_H */
OLDNEW
« no previous file with comments | « mozilla/nsprpub/lib/ds/plarena.c ('k') | mozilla/nsprpub/lib/ds/plhash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698