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

Unified Diff: nspr/lib/ds/plarena.h

Issue 1504923011: Update NSS to 3.21 RTM and NSPR to 4.11 RTM (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/nss
Patch Set: Created 5 years 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: nspr/lib/ds/plarena.h
diff --git a/nspr/lib/ds/plarena.h b/nspr/lib/ds/plarena.h
index 3e51f835b312e29d88b3be71e2bfad6ef66f9feb..4daafa8cf51f07e8f151af7911c465076ccd9250 100644
--- a/nspr/lib/ds/plarena.h
+++ b/nspr/lib/ds/plarena.h
@@ -137,9 +137,9 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
#define PL_ARENA_ALLOCATE(p, pool, nb) \
PR_BEGIN_MACRO \
PLArena *_a = (pool)->current; \
- PRUint32 _nb = PL_ARENA_ALIGN(pool, nb); \
+ PRUint32 _nb = PL_ARENA_ALIGN(pool, (PRUint32)nb); \
PRUword _p = _a->avail; \
- if (_nb < nb) { \
+ if (_nb < (PRUint32)nb) { \
_p = 0; \
} else if (_nb > (_a->limit - _a->avail)) { \
_p = (PRUword)PL_ArenaAllocate(pool, _nb); \
@@ -148,27 +148,27 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
} \
p = (void *)_p; \
if (p) { \
- PL_MAKE_MEM_UNDEFINED(p, nb); \
- PL_ArenaCountAllocation(pool, nb); \
+ PL_MAKE_MEM_UNDEFINED(p, (PRUint32)nb); \
+ PL_ArenaCountAllocation(pool, (PRUint32)nb); \
} \
PR_END_MACRO
#define PL_ARENA_GROW(p, pool, size, incr) \
PR_BEGIN_MACRO \
PLArena *_a = (pool)->current; \
- PRUint32 _incr = PL_ARENA_ALIGN(pool, incr); \
- if (_incr < incr) { \
+ PRUint32 _incr = PL_ARENA_ALIGN(pool, (PRUint32)incr); \
+ if (_incr < (PRUint32)incr) { \
p = NULL; \
} else if (_a->avail == (PRUword)(p) + PL_ARENA_ALIGN(pool, size) && \
_incr <= (_a->limit - _a->avail)) { \
- PL_MAKE_MEM_UNDEFINED((unsigned char *)(p) + size, incr); \
+ PL_MAKE_MEM_UNDEFINED((unsigned char *)(p) + size, (PRUint32)incr); \
_a->avail += _incr; \
- PL_ArenaCountInplaceGrowth(pool, size, incr); \
+ PL_ArenaCountInplaceGrowth(pool, size, (PRUint32)incr); \
} else { \
- p = PL_ArenaGrow(pool, p, size, incr); \
+ p = PL_ArenaGrow(pool, p, size, (PRUint32)incr); \
} \
if (p) {\
- PL_ArenaCountGrowth(pool, size, incr); \
+ PL_ArenaCountGrowth(pool, size, (PRUint32)incr); \
} \
PR_END_MACRO

Powered by Google App Engine
This is Rietveld 408576698