summaryrefslogtreecommitdiff
path: root/runtime/linear_alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/linear_alloc.h')
-rw-r--r--runtime/linear_alloc.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/linear_alloc.h b/runtime/linear_alloc.h
index fcabcc803e..c10ddfda9f 100644
--- a/runtime/linear_alloc.h
+++ b/runtime/linear_alloc.h
@@ -28,7 +28,10 @@ class LinearAlloc {
public:
explicit LinearAlloc(ArenaPool* pool);
- void* Alloc(Thread* self, size_t size);
+ void* Alloc(Thread* self, size_t size) LOCKS_EXCLUDED(lock_);
+
+ // Realloc never frees the input pointer, it is the caller's job to do this if necessary.
+ void* Realloc(Thread* self, void* ptr, size_t old_size, size_t new_size) LOCKS_EXCLUDED(lock_);
// Allocate and construct an array of structs of type T.
template<class T>
@@ -37,7 +40,12 @@ class LinearAlloc {
}
// Return the number of bytes used in the allocator.
- size_t GetUsedMemory() const;
+ size_t GetUsedMemory() const LOCKS_EXCLUDED(lock_);
+
+ ArenaPool* GetArenaPool() LOCKS_EXCLUDED(lock_);
+
+ // Return true if the linear alloc contrains an address.
+ bool Contains(void* ptr) const;
private:
mutable Mutex lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;