emacs-devel
[Top][All Lists]
Advanced

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

[RFC] inline DEFUNs


From: Dmitry Antipov
Subject: [RFC] inline DEFUNs
Date: Wed, 04 Dec 2013 13:44:47 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

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.

Dmitry

Attachment: inline_defun.patch
Description: Text Data


reply via email to

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