]> Sergey Matveev's repositories - public-inbox.git/commit
hl_mod: don't memoize highlight::codeGenerator objects
authorEric Wong <e@80x24.org>
Mon, 4 Oct 2021 06:10:21 +0000 (06:10 +0000)
committerEric Wong <e@80x24.org>
Mon, 4 Oct 2021 09:42:15 +0000 (09:42 +0000)
commit6248a7ab1046d0ccdc0b244099fb241fd52d653e
treefb076f47e378fc75ff212d01d40ca20264e2411a
parentb28e74c9dc0acad164187f6f584f815df1bc6ec7
hl_mod: don't memoize highlight::codeGenerator objects

Making them immortal doesn't seem worth it, since doing immortal
allocations after process startup leads to fragmentation.  While
the allocations made by highlight are small, those small
allocations can break up contiguous regions and prevent
consolidation by the malloc implementation.

Since instantiating code generators doesn't seem too expensive,
just use and delete them ASAP.
lib/PublicInbox/HlMod.pm
t/hl_mod.t