diff options
author | Justus Winter <justus@g10code.com> | 2016-11-10 14:47:00 +0100 |
---|---|---|
committer | Justus Winter <justus@g10code.com> | 2016-11-10 14:57:07 +0100 |
commit | ee08677d63a900cea85228024861a4f5c5a87c69 (patch) | |
tree | 12423ecc54138a8878e09e327ff731b8fed7512e /tests | |
parent | gpgscm: Recover cells used to maintain interpreter state. (diff) | |
download | gnupg2-ee08677d63a900cea85228024861a4f5c5a87c69.tar.xz gnupg2-ee08677d63a900cea85228024861a4f5c5a87c69.zip |
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@g10code.com>
Diffstat (limited to '')
-rw-r--r-- | tests/gpgscm/scheme.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c index 105d2a122..146b9e679 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) { |