[Pkg-gnupg-commit] [gnupg2] 235/292: gpgscm: Recover cells from the list of recently allocated cells.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Nov 21 06:31:46 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit ee08677d63a900cea85228024861a4f5c5a87c69
Author: Justus Winter <justus at g10code.com>
Date:   Thu Nov 10 14:47:00 2016 +0100

    gpgscm: Recover cells from the list of recently allocated cells.
    
    * tests/gpgscm/scheme.c (ok_to_freely_gc): Recover cells.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 tests/gpgscm/scheme.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 105d2a1..146b9e6 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -805,6 +805,17 @@ static void push_recent_alloc(scheme *sc, pointer recent, pointer extra)
   car(sc->sink) = holder;
 }
 
+static INLINE void ok_to_freely_gc(scheme *sc)
+{
+  pointer a = car(sc->sink), next;
+  car(sc->sink) = sc->NIL;
+  while (a != sc->NIL)
+    {
+      next = cdr(a);
+      free_cell(sc, a);
+      a = next;
+    }
+}
 
 static pointer get_cell(scheme *sc, pointer a, pointer b)
 {
@@ -832,12 +843,6 @@ static pointer get_vector_object(scheme *sc, int len, pointer init)
   return cells;
 }
 
-static INLINE void ok_to_freely_gc(scheme *sc)
-{
-  car(sc->sink) = sc->NIL;
-}
-
-
 #if defined TSGRIND
 static void check_cell_alloced(pointer p, int expect_alloced)
 {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list