diff options
author | Avi Kivity <avi@redhat.com> | 2012-10-17 17:14:41 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-10-17 17:14:41 +0200 |
commit | 2be0e25f4b6a4f91e39388cc365bbe53b56ab62a (patch) | |
tree | 98199f0b7ed9ee4bbe571a82daf590b5f9c3ed1f /memory.c | |
parent | 2725aec70114cf1bee00443aeb47a305f9b0c665 (diff) |
memory: abort if a memory region is destroyed during a transaction
Destroying a memory region is illegal within a transaction, as until
the transaction is committed, the memory core may hold references to
the region. Add an assert to check for violations of this rule.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1022,6 +1022,7 @@ void memory_region_init_reservation(MemoryRegion *mr, void memory_region_destroy(MemoryRegion *mr) { assert(QTAILQ_EMPTY(&mr->subregions)); + assert(memory_region_transaction_depth == 0); mr->destructor(mr); memory_region_clear_coalescing(mr); g_free((char *)mr->name); |