Quote:
|
Originally Posted by Skyld
you would most likely get a lot of memory being wasted
|
on the contrary, it is actually very memory efficient.
especially as there is usually only a few edit boxes active at any one time.
plus, you could further squish the format anyways
r:5,0,6,4:hello\nworld\n
(24 bytes)
d:5,0:hello\nworld\n
(20 bytes)
also, think about it. how many undos are usually active in the buffer anyways? most are just adds. in theory, adding a lengthy undo buffer using a log would maybe double the amount of memory used for the control, plus the header part for each entry. it might increase it by 2 1/2 times at the most, which isn't really that much considering what's usually in them... say less than 500 bytes worth of data. If, however, its a short novel or a lengthy script (say the max script size of 64k) then it would be a considerable increase (64k+64k+64k or 192k in this example). that, though, is worst-case. on average (say, 250b -> 750b), it wouldn't be that noticable.
( 72 undos used in this edit

lineup: 59 adds, 2 deletes, 11 replaces)