Module: xenomai-3
Branch: wip/heapmem
Commit: 9ce3b7413d520e52daacd70574ed9260e7d4cabb
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9ce3b7413d520e52daacd70574ed9260e7d4cabb

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Apr 23 10:47:28 2018 +0200

copperplate/heapobj-pshared: add helper to return the total heap size

---

 include/copperplate/heapobj.h     |    2 ++
 lib/copperplate/heapobj-pshared.c |    6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/include/copperplate/heapobj.h b/include/copperplate/heapobj.h
index 4cf947e..dc2a45d 100644
--- a/include/copperplate/heapobj.h
+++ b/include/copperplate/heapobj.h
@@ -304,6 +304,8 @@ size_t heapobj_validate(struct heapobj *hobj,
 
 size_t heapobj_inquire(struct heapobj *hobj);
 
+size_t heapobj_get_size(struct heapobj *hobj);
+
 int heapobj_bind_session(const char *session);
 
 void heapobj_unbind_session(void);
diff --git a/lib/copperplate/heapobj-pshared.c 
b/lib/copperplate/heapobj-pshared.c
index e08b033..6f1ca3a 100644
--- a/lib/copperplate/heapobj-pshared.c
+++ b/lib/copperplate/heapobj-pshared.c
@@ -1092,6 +1092,12 @@ size_t heapobj_inquire(struct heapobj *hobj)
        return heap->ubytes;
 }
 
+size_t heapobj_get_size(struct heapobj *hobj)
+{
+       struct shared_heap *heap = __mptr(hobj->pool_ref);
+       return heap->total;
+}
+
 void *xnmalloc(size_t size)
 {
        return alloc_block(&main_heap.heap, size);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to