31 friend class ZList<ZMemory>;
32
33 private:
34 uintptr_t _start;
35 uintptr_t _end;
36 ZListNode<ZMemory> _node;
37
38 public:
39 ZMemory(uintptr_t start, size_t size);
40
41 uintptr_t start() const;
42 uintptr_t end() const;
43 size_t size() const;
44
45 void shrink_from_front(size_t size);
46 void shrink_from_back(size_t size);
47 void grow_from_front(size_t size);
48 void grow_from_back(size_t size);
49 };
50
51 class ZMemoryManager VALUE_OBJ_CLASS_SPEC {
52 private:
53 ZList<ZMemory> _freelist;
54
55 public:
56 uintptr_t alloc_from_front(size_t size);
57 uintptr_t alloc_from_back(size_t size);
58 void free(uintptr_t start, size_t size);
59 };
60
61 #endif // SHARE_GC_Z_ZMEMORY_HPP
|
31 friend class ZList<ZMemory>;
32
33 private:
34 uintptr_t _start;
35 uintptr_t _end;
36 ZListNode<ZMemory> _node;
37
38 public:
39 ZMemory(uintptr_t start, size_t size);
40
41 uintptr_t start() const;
42 uintptr_t end() const;
43 size_t size() const;
44
45 void shrink_from_front(size_t size);
46 void shrink_from_back(size_t size);
47 void grow_from_front(size_t size);
48 void grow_from_back(size_t size);
49 };
50
51 class ZMemoryManager {
52 private:
53 ZList<ZMemory> _freelist;
54
55 public:
56 uintptr_t alloc_from_front(size_t size);
57 uintptr_t alloc_from_back(size_t size);
58 void free(uintptr_t start, size_t size);
59 };
60
61 #endif // SHARE_GC_Z_ZMEMORY_HPP
|