[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Alternative to scm_protects?
From: |
Ludovic Courtès |
Subject: |
Re: Alternative to scm_protects? |
Date: |
Tue, 01 Jul 2014 11:54:04 +0200 |
User-agent: |
Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux) |
Since Guile 2.0, which switched to BDW-GC, scm_protects has been mostly
irrelevant because BDW-GC scans all the C global variables.
Actually, libguile/gc.c in 2.0 reads this:
--8<---------------cut here---------------start------------->8---
#if SCM_ENABLE_DEPRECATED == 1
/* Hash table that keeps a reference to objects the user wants to protect from
garbage collection. It could arguably be private but applications have come
to rely on it (e.g., Lilypond 2.13.9). */
SCM scm_protects;
#else
static SCM scm_protects;
#endif
--8<---------------cut here---------------end--------------->8---
So the alternative to scm_protects should be just something like this:
static SCM my_protects;
...
my_protects = scm_cons (obj, my_protects); /* or a hash table */
Would it work for LilyPond?
Ludo’.
- Re: Alternative to scm_protects?,
Ludovic Courtès <=