Hi, Does SynEdit as used in Lazarus IDE use a gapped buffer to store it's text? I just read about 'gapped buffer' in the Java documentation and did some Googling to see what it is. A dynamic array is some sort of gapped buffer, but not optimized and the gap is always at the end of the array.
If SynEdit does use a gapped buffer, does FPC contain an implementation? <Quote> http://slashdot.org/developers/00/10/27/1516243.shtml NEdit stores text in a simple gapped-buffer structure, common to many text editors. The gapped-buffer is a block of memory with a moving hole in it. NEdit maintains the gap's size and continuously relocates it as part of the insertion / deletion process. This organization maps exceptionally well to how people actually use a text editor, and is very effective at minimizing the number and size of memory relocations that need to happen as users add and delete text. For comparison, another common approach to storage in a text editor is to break the text into linked blocks so that any given modification affects only a limited number of blocks. While this better limits worst-case memory movement; it also breaks up and scatters the stored data, destroying its locality; so the virtual memory system can't swap it as efficiently. </Quote> For more information see: http://en.wikipedia.org/wiki/Gap_buffer http://www.lazyhacker.com/gapbuffer/gapbuffer.htm Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ Lazarus mailing list [email protected] http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
