From 579ea5500a0bcf4ad2a7fd223028959ae38b1ac1 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 28 Mar 2011 22:56:15 +0000 Subject: [PATCH] memory leaks for rentry --- Robust/src/Runtime/mlp_runtime.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Robust/src/Runtime/mlp_runtime.c b/Robust/src/Runtime/mlp_runtime.c index 4668f30c..28010956 100644 --- a/Robust/src/Runtime/mlp_runtime.c +++ b/Robust/src/Runtime/mlp_runtime.c @@ -549,6 +549,9 @@ int ADDVECTOR(MemoryQueue *Q, REntry *r) { if (isParentCoarse(r)) { //parent's retire immediately atomic_dec(&V->item.total); V->index--; + } else { + if (atomic_sub_and_test(1, &r->count)) + poolfreeinto(Q->rentrypool, r); } return READY; } else { @@ -580,6 +583,8 @@ int ADDSCC(MemoryQueue *Q, REntry *r) { void* flag=NULL; flag=(void*)LOCKXCHG((unsigned INTPTR*)&(S->val), (unsigned INTPTR)flag); if (flag!=NULL) { + if (atomic_sub_and_test(1, &r->count)) + poolfreeinto(Q->rentrypool, r); return READY; } else { return NOTREADY;//<- means that some other dispatcher got this one...so need to do accounting correctly -- 2.34.1