summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%google.com <devnull@localhost>2013-02-11 15:36:33 +0000
committerwtc%google.com <devnull@localhost>2013-02-11 15:36:33 +0000
commitdc8404cb69220189f39ffc0fe9cc9fee1e49cd1e (patch)
treec2b009558720bef76b97be4562f73a08ae12c24c
parentbe416b4497c859ffd05a7d26f42ebcf394db86bf (diff)
downloadnspr-hg-dc8404cb69220189f39ffc0fe9cc9fee1e49cd1e.tar.gz
Bug 807883: Add 'const' to the 'pool' parameter and 'arena' local variableNSPR_4_9_6_BETA2
of PL_SizeOfArenaPoolExcludingPool. Fix comments. r=n.nethercote. Modified Files: plarena.c plarenas.h
-rw-r--r--lib/ds/plarena.c6
-rw-r--r--lib/ds/plarenas.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/ds/plarena.c b/lib/ds/plarena.c
index cc2ffb00..40531951 100644
--- a/lib/ds/plarena.c
+++ b/lib/ds/plarena.c
@@ -346,14 +346,14 @@ PR_IMPLEMENT(void) PL_ArenaFinish(void)
}
PR_IMPLEMENT(size_t) PL_SizeOfArenaPoolExcludingPool(
- PLArenaPool *pool, PLMallocSizeFn mallocSizeOf)
+ const PLArenaPool *pool, PLMallocSizeFn mallocSizeOf)
{
/*
* The first PLArena is within |pool|, so don't measure it. Subsequent
- * PLArenas are separate and must measured.
+ * PLArenas are separate and must be measured.
*/
size_t size = 0;
- PLArena *arena = pool->first.next;
+ const PLArena *arena = pool->first.next;
while (arena) {
size += mallocSizeOf(arena);
arena = arena->next;
diff --git a/lib/ds/plarenas.h b/lib/ds/plarenas.h
index 4cbe32c4..f4a00cd1 100644
--- a/lib/ds/plarenas.h
+++ b/lib/ds/plarenas.h
@@ -61,17 +61,17 @@ PR_EXTERN(void) PL_ArenaRelease(PLArenaPool *pool, char *mark);
PR_EXTERN(void) PL_ClearArenaPool(PLArenaPool *pool, PRInt32 pattern);
/*
-** A function like malloc_size() or malloc_usable_size() that returns the
+** A function like malloc_size() or malloc_usable_size() that measures the
** size of a heap block.
*/
typedef size_t (*PLMallocSizeFn)(const void *ptr);
/*
-** Return all memory used by a PLArenaPool, excluding the PLArenaPool
+** Measure all memory used by a PLArenaPool, excluding the PLArenaPool
** structure.
*/
PR_EXTERN(size_t) PL_SizeOfArenaPoolExcludingPool(
- PLArenaPool *pool, PLMallocSizeFn mallocSizeOf);
+ const PLArenaPool *pool, PLMallocSizeFn mallocSizeOf);
PR_END_EXTERN_C