emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic loading progress


From: Aurélien Aptel
Subject: Re: Dynamic loading progress
Date: Wed, 11 Feb 2015 10:43:01 +0100

In other news, I stayed up waaay too late yesterday but I got the
destructor thing working! It's pushed on my branch.

I added a new Lisp_Misc subtype called Lisp_Module which stores:
- a module id
- a void* user pointer
- a function pointer to a destructor to release the resources of the
user pointer

There's a module_make_id() function that module can used to get a new
unique id and a module_make_object(id, dtor, userp) that allocates a
new module Lisp_Object.

The destructor is called in by the GC in sweep_misc(), which sweeps
the marker list (all misc subtypes use the marker list, maybe this
should be documented somewhere).

I've added a new source file for module functions in src/module.c.
I've tried to ifdef'd everything properly: --without-ltdl has no
runtime cost, as it should be.

I have made an example module that uses this new lisp type in
modules/memtest along with a ERT test.

You can browse the commit here [1], it's relatively easy to follow.

One thing I haven't checked is whether adding the Lisp_Module to the
Lisp_Misc union changes its size (the existing comments say this is
important).

1: 
https://github.com/aaptel/emacs-dynamic-module/commit/c59f2deaae99ca85b0a4fcdd53a3d8ed41d995cd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]