aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index f85774a11f..e04d5196b0 100644
--- a/memory.c
+++ b/memory.c
@@ -1019,6 +1019,20 @@ Object *memory_region_owner(MemoryRegion *mr)
return mr->owner;
}
+void memory_region_ref(MemoryRegion *mr)
+{
+ if (mr && mr->owner) {
+ object_ref(mr->owner);
+ }
+}
+
+void memory_region_unref(MemoryRegion *mr)
+{
+ if (mr && mr->owner) {
+ object_unref(mr->owner);
+ }
+}
+
uint64_t memory_region_size(MemoryRegion *mr)
{
if (int128_eq(mr->size, int128_2_64())) {