| Index: src/zone.h
|
| diff --git a/src/zone.h b/src/zone.h
|
| index 864846553a234d82cfd88c3e527f1f5c7416e654..9bcbbf689d43b5eb99a75f2ef1648847eaa2c7ca 100644
|
| --- a/src/zone.h
|
| +++ b/src/zone.h
|
| @@ -164,16 +164,11 @@ class ZoneObject {
|
| };
|
|
|
|
|
| -// The ZoneListAllocationPolicy is used to specialize the GenericList
|
| -// implementation to allocate ZoneLists and their elements in the
|
| -// Zone.
|
| -class ZoneListAllocationPolicy {
|
| - public:
|
| - // Allocate 'size' bytes of memory in the zone.
|
| - static void* New(int size);
|
| -
|
| - // De-allocation attempts are silently ignored.
|
| - static void Delete(void* p) { }
|
| +// The ZoneAllocationPolicy is used to specialize the generic data
|
| +// structures to allocate themselves and their elements in the Zone.
|
| +struct ZoneAllocationPolicy {
|
| + INLINE(void* New(size_t size));
|
| + INLINE(static void Delete(void *pointer)) { }
|
| };
|
|
|
|
|
| @@ -182,20 +177,20 @@ class ZoneListAllocationPolicy {
|
| // Zone. ZoneLists cannot be deleted individually; you can delete all
|
| // objects in the Zone by calling Zone::DeleteAll().
|
| template<typename T>
|
| -class ZoneList: public List<T, ZoneListAllocationPolicy> {
|
| +class ZoneList: public List<T, ZoneAllocationPolicy> {
|
| public:
|
| - INLINE(void* operator new(size_t size));
|
| - INLINE(void* operator new(size_t size, Zone* zone));
|
| -
|
| // Construct a new ZoneList with the given capacity; the length is
|
| // always zero. The capacity must be non-negative.
|
| explicit ZoneList(int capacity)
|
| - : List<T, ZoneListAllocationPolicy>(capacity) { }
|
| + : List<T, ZoneAllocationPolicy>(capacity) { }
|
| +
|
| + INLINE(void* operator new(size_t size, Zone* zone));
|
| + INLINE(void* operator new(size_t size));
|
|
|
| // Construct a new ZoneList by copying the elements of the given ZoneList.
|
| - explicit ZoneList(const ZoneList<T>& other)
|
| - : List<T, ZoneListAllocationPolicy>(other.length()) {
|
| - AddAll(other);
|
| + explicit ZoneList(const ZoneList<T>& other, ZoneAllocationPolicy allocator)
|
| + : List<T, ZoneAllocationPolicy>(other.length()) {
|
| + AddAll(other, allocator);
|
| }
|
|
|
| void operator delete(void* pointer) { UNREACHABLE(); }
|
| @@ -232,15 +227,15 @@ class ZoneScope BASE_EMBEDDED {
|
| // different configurations of a concrete splay tree (see splay-tree.h).
|
| // The tree itself and all its elements are allocated in the Zone.
|
| template <typename Config>
|
| -class ZoneSplayTree: public SplayTree<Config, ZoneListAllocationPolicy> {
|
| +class ZoneSplayTree: public SplayTree<Config, ZoneAllocationPolicy> {
|
| public:
|
| ZoneSplayTree()
|
| - : SplayTree<Config, ZoneListAllocationPolicy>() {}
|
| + : SplayTree<Config, ZoneAllocationPolicy>() {}
|
| ~ZoneSplayTree();
|
| };
|
|
|
|
|
| -typedef TemplateHashMapImpl<ZoneListAllocationPolicy> ZoneHashMap;
|
| +typedef TemplateHashMapImpl<ZoneAllocationPolicy> ZoneHashMap;
|
|
|
| } } // namespace v8::internal
|
|
|
|
|