diff options
author | Simon Hausmann <[email protected]> | 2013-09-18 21:13:03 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-09-20 14:27:24 +0200 |
commit | c392069685c9b6c6dec11cc8f1179a2c4e15be13 (patch) | |
tree | b1b232649bcc566d80cef86577d892edf09ff5f7 /src/qml/jsruntime/qv4executableallocator_p.h | |
parent | 8c3f133bc34e2c72d4decc0c9af59965d964bbed (diff) |
Allow delayed deallocation in the executable memory allocator
Allow for allocations to outlive the allocator itself. When the allocator dies,
it invalidates any remaining non-free allocations, making them safe to delete
later.
Change-Id: I6c71cddbbd5dcaff1ad50f3991a3c710d4f96737
Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4executableallocator_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4executableallocator_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4executableallocator_p.h b/src/qml/jsruntime/qv4executableallocator_p.h index feba5d7e3d..b4fb2fb0e5 100644 --- a/src/qml/jsruntime/qv4executableallocator_p.h +++ b/src/qml/jsruntime/qv4executableallocator_p.h @@ -81,8 +81,13 @@ public: {} void *start() const; + void invalidate() { addr = 0; } + bool isValid() const { return addr != 0; } + void deallocate(ExecutableAllocator *allocator); private: + ~Allocation() {} + friend class ExecutableAllocator; Allocation *split(size_t dividingSize); |