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

Unified Diff: src/heap-inl.h

Issue 2645004: Add an API to control the disposal of external string resources... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 6 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 | « src/heap.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-inl.h
===================================================================
--- src/heap-inl.h (revision 4799)
+++ src/heap-inl.h (working copy)
@@ -117,7 +117,14 @@
reinterpret_cast<byte*>(string) +
ExternalString::kResourceOffset -
kHeapObjectTag);
- delete *resource_addr;
+
+ // Dispose of the C++ object.
+ if (external_string_dispose_callback_ != NULL) {
+ external_string_dispose_callback_(*resource_addr);
+ } else {
+ delete *resource_addr;
+ }
+
// Clear the resource pointer in the string.
*resource_addr = NULL;
}
« no previous file with comments | « src/heap.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698