[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: atexit in modules
From: |
Ludovic Courtès |
Subject: |
Re: atexit in modules |
Date: |
Mon, 17 Nov 2008 01:00:14 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) |
Hello,
Mike Gran <address@hidden> writes:
> Idea 1 was to wrap as library_init() as a scheme function that gets
> called when the scheme module is loaded, and then wrap library_end()
> as a scheme function that gets called when the module is unloaded.
> But, modules are never unloaded.
Yeah, that detail was the fun part of my proposal. :-)
> Idea 4: So ultimately I went with this. The C function library_init()
> gets called in init_foo() in the call to (load-extension "libfoo.so"
> "init_foo"). The C function library_end() gets registered using the
> libc atexit() during the same call to init_foo(). That works fine.
Indeed, couldn't be any simpler.
Thanks,
Ludo'.