Hi,

> (step 1) Rewrite class CellBuffer so that chars and
> styles are stored in two separatly allocated blocks of
> memory (each one using the same schema: two block of
> valid bytes diveded by gap). The current interface of
> the class would be kept unchanged and only one new
> method added. The new method would be read-only
> relative of GetCharRange() - it would return pointer to
> the inside of the CellBuffer (after calling gapTo(0)).
>
> Maybe this is the most controversial step of the
> suggestion. It can make Scintilla somewhat slower
> becuase rule of locality is crossed - styles related to
> their chars are far away in memory so CPU cache will be
> less effective.

I've been looking at trying to use PCRE for regex search with Scintilla
too, and hit upon the same stumbling block as you. With the inbuilt RE
engine it was a fairly simple task for Neil to replace the char indexing
with an accessor. I don't think this will be so for PCRE. I looked at the
code and replacing all the char* access with an accessor class instead
will be a huge task - this is what has put me off doing it so far.

However, I'm not willing to sacrifice the speed of the text editor for the
purposes of using RE. It's just a shame that the only real alternative
seems to be to read the entire document into a buffer for searching.

Other solutions I have seen involve using a moving window to feed to PCRE
receiving say 1k at a time from Scintilla and running PCRE over it. This,
however, will not work with REs that have matches over the boundary point.

Does anyone have any other suggestions as to how best to feed the buffer
contents to an RE engine? Most I've seen expect a char buffer to search.

Thanks,

Simon.

_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to