Bug 971208 - Eliminate vanilla new in SegmentedVector.h, r=mjrosenb

--HG--
extra : rebase_source : 00761e68f7821f38a46e2442870bf3d214d370f9
This commit is contained in:
Steve Fink 2014-02-11 15:02:48 -08:00
parent adf07b6ec9
commit 5253bae27f

View File

@ -29,6 +29,7 @@
#ifndef assembler_wtf_SegmentedVector_h
#define assembler_wtf_SegmentedVector_h
#include "js/Utility.h"
#include "js/Vector.h"
namespace WTF {
@ -149,7 +150,7 @@ namespace WTF {
}
if (!segmentExistsFor(m_size - 1))
m_segments.append(new Segment);
m_segments.append(js_new<Segment>());
//segmentFor(m_size - 1)->uncheckedAppend(value);
segmentFor(m_size - 1)->append(value);
}
@ -247,7 +248,7 @@ namespace WTF {
{
ASSERT(segmentIndex <= m_segments.size());
if (segmentIndex == m_segments.size())
m_segments.append(new Segment);
m_segments.append(js_new<Segment>());
m_segments[segmentIndex]->grow(size);
}