Module: xenomai-3
Branch: next
Commit: a6cdfb8578868e3def6341aeda8dd6989e770d4b
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=a6cdfb8578868e3def6341aeda8dd6989e770d4b

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Jun 21 12:13:53 2015 +0200

copperplate/heapobj-malloc: fix usage tracking

---

 lib/copperplate/heapobj-malloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/copperplate/heapobj-malloc.c b/lib/copperplate/heapobj-malloc.c
index 9dbed81..88a720b 100644
--- a/lib/copperplate/heapobj-malloc.c
+++ b/lib/copperplate/heapobj-malloc.c
@@ -146,10 +146,10 @@ void pvheapobj_free(struct heapobj *hobj, void *ptr)
        struct pool_header *ph = hobj->priv.pool;
 
        assert(hobj->size >= bh->size);
-       __STD(free(bh));
        write_lock(&ph->lock);
        ph->used -= bh->size;
        write_unlock(&ph->lock);
+       __STD(free(bh));
 }
 
 size_t pvheapobj_inquire(struct heapobj *hobj)


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

Reply via email to