[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to add Guile support to a package
From: |
Chris Vine |
Subject: |
Re: How to add Guile support to a package |
Date: |
Mon, 5 Jan 2015 13:18:11 +0000 |
On Mon, 5 Jan 2015 11:05:31 +0100
Hans Aberg <address@hidden> wrote:
>
> > On 5 Jan 2015, at 10:19, Antonio Ceballos <address@hidden>
> > wrote:
>
> > GNU Chess has not been using the garbage collector so far.
>
> There is an issue when using C++ global objects having initializers
> doing allocations, on platforms (as on OS X) where the GC initializer
> must run first.
Does this include guile-2.0? That uses the gc library, which seems to
require some precautions to be taken on Darwin as regards the loading
of dynamic libraries, but I have not heard of problems interfacing with
static global objects where those static objects are conventionally
allocated rather than GC'ed.
In any event, I have not had problems getting guile to work as an
optional extension language for a C++ program with linux, from the
memory allocation point of view. There are however issues with
accommodating guile exceptions, which are basically long jumps, to
C++ objects with non-trivial destructors. You have to organize the
code so that no guile exception can take such a C++ object out of
scope, and no C++ exception can propagate out of a guile dynwind block.
Chris