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

Unified Diff: runtime/lib/regexp_jsc.cc

Issue 10836061: Change the zone allocation api. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | runtime/lib/string.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/regexp_jsc.cc
===================================================================
--- runtime/lib/regexp_jsc.cc (revision 10253)
+++ runtime/lib/regexp_jsc.cc (working copy)
@@ -16,9 +16,8 @@
namespace dart {
static uint16_t* GetTwoByteData(const String& str) {
- intptr_t size = str.Length() * sizeof(uint16_t);
Zone* zone = Isolate::Current()->current_zone();
- uint16_t* two_byte_str = reinterpret_cast<uint16_t*>(zone->Allocate(size));
+ uint16_t* two_byte_str = zone->Alloc<uint16_t>(str.Length());
for (intptr_t i = 0; i < str.Length(); i++) {
two_byte_str[i] = str.CharAt(i);
}
@@ -126,8 +125,7 @@
const int kJscreMultiple = 3;
int offsets_length = (num_bracket_expressions + 1) * kJscreMultiple;
int* offsets = NULL;
- int offsets_array_size = offsets_length * sizeof(offsets[0]);
- offsets = reinterpret_cast<int*>(zone->Allocate(offsets_array_size));
+ offsets = zone->Alloc<int>(offsets_length);
int retval = jscre::jsRegExpExecute(jscregexp,
two_byte_str,
str.Length(),
« no previous file with comments | « no previous file | runtime/lib/string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698