[Top][All Lists]

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

Re: bool-vector implementation in the Emacs core

From: Kenichi Handa
Subject: Re: bool-vector implementation in the Emacs core
Date: Fri, 23 Jan 2004 09:37:36 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, address@hidden (Kim F. Storm) writes:
>>  I did a search on this topic, but could not find anything.  I hope my
>>  proposal is of interest to people other than Gnus developers (Unicode
>>  coders, for instance).

> It's a good question -- will unicode benefit from this at the C-level? 

I'm not sure.  Emacs-unicode uses char-table for many
things.  It is a pseudo array of 0..#x3FFFFF.  So, if
indices fit in this range, you can use it not only for a
character, but for any integer.

Ex. Set `t' to these ranges: (1 (6 . 8) 1000 (1500 . 1600) 2000)

(setq tbl (make-char-table nil))
(aset tbl 1 t)
(set-char-table-range tbl '(6 . 8) t)
(aset tbl 1000 t)
(set-char-table-range tbl '(1500 . 1600) t)
(aset tbl 2000 t)

It may consume more memory than ranges or inversion list,
(aref tbl N) is quite faster than them.

It is also possible to implement a code that doesn't limit
the range to 0..#x3fffff if it is really required.

Ken'ichi HANDA

reply via email to

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