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

Unified Diff: nss/mozilla/nsprpub/lib/ds/plarena.c

Issue 3135002: Update to NSS 3.12.7 and NSPR 4.8.6.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: nss/mozilla/nsprpub/lib/ds/plarena.c
===================================================================
--- nss/mozilla/nsprpub/lib/ds/plarena.c (revision 55475)
+++ nss/mozilla/nsprpub/lib/ds/plarena.c (working copy)
@@ -256,6 +256,21 @@
return newp;
}
+static void ClearArenaList(PLArena *a, PRInt32 pattern)
+{
+
+ for (; a; a = a->next) {
+ PR_ASSERT(a->base <= a->avail && a->avail <= a->limit);
+ a->avail = a->base;
+ PL_CLEAR_UNUSED_PATTERN(a, pattern);
+ }
+}
+
+PR_IMPLEMENT(void) PL_ClearArenaPool(PLArenaPool *pool, PRInt32 pattern)
+{
+ ClearArenaList(pool->first.next, pattern);
+}
+
/*
* Free tail arenas linked after head, which may not be the true list head.
* Reset pool->current to point to head in case it pointed at a tail arena.
@@ -270,12 +285,7 @@
return;
#ifdef DEBUG
- do {
- PR_ASSERT(a->base <= a->avail && a->avail <= a->limit);
- a->avail = a->base;
- PL_CLEAR_UNUSED(a);
- } while ((a = a->next) != 0);
- a = *ap;
+ ClearArenaList(a, PL_FREE_PATTERN);
#endif
if (reallyFree) {

Powered by Google App Engine
This is Rietveld 408576698