emacs-devel
[Top][All Lists]
Advanced

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

Re: [RFC] inline DEFUNs


From: Eli Zaretskii
Subject: Re: [RFC] inline DEFUNs
Date: Wed, 04 Dec 2013 18:19:50 +0200

> Date: Wed, 04 Dec 2013 13:44:47 +0400
> From: Dmitry Antipov <address@hidden>
> 
> Recent discussion about dropping selected_window (started at
> http://lists.gnu.org/archive/html/emacs-devel/2013-11/msg01090.html)
> raises an interesting question.  In short, we want Fselected_window
> fast (read: inline in C) but still accessible from Lisp.
> 
> Possible solution is to split DEFSUBR from DEFUN and use DEFINLINE in
> .h to define inline function, with matching DEFSUBR somewhere in .c.
> Attached patch converts Fcurrent_buffer to inline function.  On my
> system, this effectively eliminates 63 calls to Fcurrent_buffer at the
> cost of increasing .text with just 48 bytes (for default '-O2 -g3' build).
> This feature also requires special support in make-docfile and Lisp code
> responsible to find and jump to a function definition.

Perhaps I don't understand some subtlety here, but the usual way of
dealing with this is to have an inline C function, which can then be
called from C, and have Fcurrent_buffer that calls that inline
function.

Am I missing something?



reply via email to

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