]> git.eshelyaron.com Git - emacs.git/commit
Tidy up the literal cacheing in CC Mode, optimizing c-full-pp-to-literal
authorAlan Mackenzie <acm@muc.de>
Sat, 1 Jun 2019 19:56:07 +0000 (19:56 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 1 Jun 2019 19:56:07 +0000 (19:56 +0000)
commit9dee49ed6439bfdf7f1c98fee767d170d144f581
treedd29f7505172f9ec9e6b3d502cb4b7295d6afa95
parent56964f3d314463c3542807645fbc3e2e969ed9b4
Tidy up the literal cacheing in CC Mode, optimizing c-full-pp-to-literal

(Intermediate commit)

* lisp/progmodes/cc-engine.el, lisp/progmodes/cc-fonts.el
* lisp/progmodes/cc-mode.el : Rename:
c-state-semi-nonlit-pos-cache -> c-lit-pos-cache,
c-state-semi-nonlit-pos-cache-limit -> c-lit-pos-cache-limit,
c-state-semi-nonlit-near-cache -> c-semi-lit-near-cache,
c-truncate-semi-nonlit-pos-cache -> c-truncate-lit-pos-cache,
c-state-semi-trim-near-cache -> c-semi-trim-near-cache,
c-state-semi-get-near-cache-entry -> c-semi-get-near-cache-entry,
c-state-semi-put-near-cache-entry -> c-semi-put-near-cache-entry,
c-state-semi-pp-to-literal -> c-semi-pp-to-literal,
c-state-full-pp-to-literal -> c-full-pp-to-literal,
c-state-semi-trim-cache -> c-trim-lit-pos-cache.

* lisp/progmodes/cc-engine.el (c-semi-near-cache-limit): New variable.
(c-truncate-lit-pos-cache): This now truncates the cache variables for all
three lit- sub-caches.
(c-semi-put-near-cache-entry): Increase c-semi-near-cache-limit to the
position of the new entry.
(c-full-near-cache-limit, c-full-lit-near-cache): New variables.
(c-full-trim-near-cache, c-full-get-near-cache-entry)
(c-full-put-near-cache-entry): New functions.
(c-full-pp-to-literal): Amend to use the new functions, and to optimize the
use of the available caches, similarly to c-semi-pp-to-literal.
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-mode.el