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:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user