[Geany] do not open oversize files

Dimitar Zhekov dimitar.zhekov at xxxxx
Tue Jan 4 17:22:42 UTC 2011


On Tue, 04 Jan 2011 11:01:44 +0100
Frank Lanitz <frank at frank.uvena.de> wrote:

> > On 1/4/11, Lex Trotman <elextr at gmail.com> wrote:
> >> Unfortunately there is no way of knowing how much memory is available,
> >> the requests for such information just return infinite (at least on my
> >> system) [...]
> > Maybe if Geany would give a warning like:
> >
> > "You're trying to open a huge file (600MB), which may cause your
> > system to work slow. Are you sure?"
> 
> Well, where to set such a point? E.g. if you have an XML-file the lexxer
> is needing much more memory than a C or a key-value-file would need.
> Also is this depending on user's system.

As a crude estimate, under Linux you can try to malloc(minimal
presumable required memory). It won't be actually allocated, unless you
memset() it or something, but if the result is NULL, a warning is
justified.

-- 
E-gards: Jimmy



More information about the Users mailing list