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

Unified Diff: src/allocation.h

Issue 23479015: thread isolate in PreallocatedStorageAllocationPolicy (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: forgot explicit dtor Created 7 years, 3 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 | src/allocation-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/allocation.h
diff --git a/src/allocation.h b/src/allocation.h
index 45bde4c4cb07068a05e301d2124990637d82609d..b70087955cbdaad42da9feee1af97d5e472c9414 100644
--- a/src/allocation.h
+++ b/src/allocation.h
@@ -104,6 +104,7 @@ char* StrNDup(const char* str, int n);
// and free. Used as the default policy for lists.
class FreeStoreAllocationPolicy {
public:
+ typedef FreeStoreAllocationPolicy Deleter;
INLINE(void* New(size_t size)) { return Malloced::New(size); }
INLINE(static void Delete(void* p)) { Malloced::Delete(p); }
};
@@ -131,9 +132,21 @@ class PreallocatedStorage {
};
-struct PreallocatedStorageAllocationPolicy {
+class Isolate;
+
+
+class PreallocatedStorageAllocationPolicy {
+ public:
+ typedef PreallocatedStorageAllocationPolicy Deleter;
+ INLINE(explicit PreallocatedStorageAllocationPolicy(Isolate* isolate))
+ : isolate_(isolate) { }
+ INLINE(PreallocatedStorageAllocationPolicy(
+ const PreallocatedStorageAllocationPolicy& policy))
+ : isolate_(policy.isolate_) { }
INLINE(void* New(size_t size));
- INLINE(static void Delete(void* ptr));
+ INLINE(void Delete(void* ptr));
+ private:
+ Isolate* isolate_;
};
« no previous file with comments | « no previous file | src/allocation-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698