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

Side by Side Diff: src/api.cc

Issue 960883003: Fix memory leak in natives-external. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/natives.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 5196 matching lines...) Expand 10 before | Expand all | Expand 10 after
5207 if (!Utils::ApiCheck(i::V8::ArrayBufferAllocator() == NULL, 5207 if (!Utils::ApiCheck(i::V8::ArrayBufferAllocator() == NULL,
5208 "v8::V8::SetArrayBufferAllocator", 5208 "v8::V8::SetArrayBufferAllocator",
5209 "ArrayBufferAllocator might only be set once")) 5209 "ArrayBufferAllocator might only be set once"))
5210 return; 5210 return;
5211 i::V8::SetArrayBufferAllocator(allocator); 5211 i::V8::SetArrayBufferAllocator(allocator);
5212 } 5212 }
5213 5213
5214 5214
5215 bool v8::V8::Dispose() { 5215 bool v8::V8::Dispose() {
5216 i::V8::TearDown(); 5216 i::V8::TearDown();
5217 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
5218 i::DisposeNatives();
5219 #endif
5217 return true; 5220 return true;
5218 } 5221 }
5219 5222
5220 5223
5221 HeapStatistics::HeapStatistics(): total_heap_size_(0), 5224 HeapStatistics::HeapStatistics(): total_heap_size_(0),
5222 total_heap_size_executable_(0), 5225 total_heap_size_executable_(0),
5223 total_physical_size_(0), 5226 total_physical_size_(0),
5224 used_heap_size_(0), 5227 used_heap_size_(0),
5225 heap_size_limit_(0) { } 5228 heap_size_limit_(0) { }
5226 5229
(...skipping 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after
7825 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7828 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7826 Address callback_address = 7829 Address callback_address =
7827 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7830 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7828 VMState<EXTERNAL> state(isolate); 7831 VMState<EXTERNAL> state(isolate);
7829 ExternalCallbackScope call_scope(isolate, callback_address); 7832 ExternalCallbackScope call_scope(isolate, callback_address);
7830 callback(info); 7833 callback(info);
7831 } 7834 }
7832 7835
7833 7836
7834 } } // namespace v8::internal 7837 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698