Bug 807883: Add 'const' to the 'pool' parameter and 'arena' local variable

of PL_SizeOfArenaPoolExcludingPool. Fix comments. r=n.nethercote.
Modified Files:
	plarena.c plarenas.h


git-svn-id: svn://10.0.0.236/trunk@264716 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
wtc%google.com
2013-02-11 15:36:33 +00:00
parent 85bfa8f006
commit 472dc0c360
2 changed files with 6 additions and 6 deletions

View File

@@ -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;

View File

@@ -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