| Index: src/allocation.h
|
| diff --git a/src/allocation.h b/src/allocation.h
|
| index 31067dda8196feed86a36c172f71e71adc8c0b85..c400387003518d82c670ce7a08b0bf0037a1dc88 100644
|
| --- a/src/allocation.h
|
| +++ b/src/allocation.h
|
| @@ -102,10 +102,21 @@ char* StrNDup(const char* str, int n);
|
|
|
| // Allocation policy for allocating in the C free store using malloc
|
| // and free. Used as the default policy for lists.
|
| -class FreeStoreAllocationPolicy {
|
| +class FreeStoreAllocator {
|
| public:
|
| - INLINE(static void* New(size_t size)) { return Malloced::New(size); }
|
| - INLINE(static void Delete(void* p)) { Malloced::Delete(p); }
|
| + INLINE(void* New(size_t size)) { return Malloced::New(size); }
|
| +};
|
| +
|
| +
|
| +class FreeStoreDeallocator {
|
| + public:
|
| + INLINE(void Delete(void *ptr)) { Malloced::Delete(ptr); }
|
| +};
|
| +
|
| +
|
| +struct FreeStoreAllocationPolicy {
|
| + typedef FreeStoreAllocator Alloc;
|
| + typedef FreeStoreDeallocator Dealloc;
|
| };
|
|
|
|
|
| @@ -117,12 +128,6 @@ class PreallocatedStorage {
|
| explicit PreallocatedStorage(size_t size);
|
| size_t size() { return size_; }
|
|
|
| - // TODO(isolates): Get rid of these-- we'll have to change the allocator
|
| - // interface to include a pointer to an isolate to do this
|
| - // efficiently.
|
| - static inline void* New(size_t size);
|
| - static inline void Delete(void* p);
|
| -
|
| private:
|
| size_t size_;
|
| PreallocatedStorage* previous_;
|
| @@ -137,6 +142,24 @@ class PreallocatedStorage {
|
| };
|
|
|
|
|
| +class PreallocatedStorageAllocator {
|
| + public:
|
| + INLINE(void* New(size_t size));
|
| +};
|
| +
|
| +
|
| +class PreallocatedStorageDeallocator {
|
| + public:
|
| + INLINE(void Delete(void* ptr));
|
| +};
|
| +
|
| +
|
| +struct PreallocatedStorageAllocationPolicy {
|
| + typedef PreallocatedStorageAllocator Alloc;
|
| + typedef PreallocatedStorageDeallocator Dealloc;
|
| +};
|
| +
|
| +
|
| } } // namespace v8::internal
|
|
|
| #endif // V8_ALLOCATION_H_
|
|
|