Lurker News

Comments (256) 54 threads

Show all comments

Showing thread 33 of 54

snissn3 replies#
Could you share what data structure you use to keep the text in? I'm curious how text editors work, since you need fast inserts anywhere, is the text a linked list?
aspaceman#
And if you want to take that a step further down the rabbit hole, here's how Lua allocates the table in memory: https://stackoverflow.com/a/29930168

It's two dynamic arrays, of hashes and values, whose sizes grow as powers of two.