Changeset 58734 in vbox for trunk/src/libs/xpcom18a4/nsprpub/lib/ds/plarena.h
- Timestamp:
- Nov 18, 2015 10:24:35 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 104171
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/nsprpub/lib/ds/plarena.h
r1 r58734 109 109 PR_BEGIN_MACRO \ 110 110 PLArena *_a = (pool)->current; \ 111 PRUint32 _nb = PL_ARENA_ALIGN(pool, nb); \111 PRUint32 _nb = PL_ARENA_ALIGN(pool, (PRUint32)nb); \ 112 112 PRUword _p = _a->avail; \ 113 PRUword _q = _p + _nb; \ 114 if (_q > _a->limit) \ 113 if (_nb < (PRUint32)nb) { \ 114 _p = 0; \ 115 } else if (_nb > (_a->limit - _a->avail)) { \ 115 116 _p = (PRUword)PL_ArenaAllocate(pool, _nb); \ 116 else \ 117 _a->avail = _q; \ 117 } else { \ 118 _a->avail += _nb; \ 119 } \ 118 120 p = (void *)_p; \ 119 PL_ArenaCountAllocation(pool, nb); \ 121 if (p) { \ 122 PL_ArenaCountAllocation(pool, nb); \ 123 } \ 120 124 PR_END_MACRO 121 125 … … 123 127 PR_BEGIN_MACRO \ 124 128 PLArena *_a = (pool)->current; \ 125 PRUint32 _incr = PL_ARENA_ALIGN(pool, incr); \126 PRUword _p = _a->avail;\127 PRUword _q = _p + _incr; \128 if (_p== (PRUword)(p) + PL_ARENA_ALIGN(pool, size) && \129 _ q <= _a->limit) { \130 _a->avail = _ q; \131 PL_ArenaCountInplaceGrowth(pool, size, incr); \129 PRUint32 _incr = PL_ARENA_ALIGN(pool, (PRUint32)incr); \ 130 if (_incr < (PRUint32)incr) { \ 131 p = NULL; \ 132 } else if (_a->avail == (PRUword)(p) + PL_ARENA_ALIGN(pool, size) && \ 133 _incr <= (_a->limit - _a->avail)) { \ 134 _a->avail = _incr; \ 135 PL_ArenaCountInplaceGrowth(pool, size, (RTUint32)incr); \ 132 136 } else { \ 133 p = PL_ArenaGrow(pool, p, size, incr); \ 134 } \ 135 PL_ArenaCountGrowth(pool, size, incr); \ 137 p = PL_ArenaGrow(pool, p, size, (PRUint32)incr); \ 138 } \ 139 if (p) { \ 140 PL_ArenaCountGrowth(pool, size, (PRUint32)incr); \ 141 } \ 136 142 PR_END_MACRO 137 143
Note:
See TracChangeset
for help on using the changeset viewer.