@AdamDanischewski as was said on #1540, Geany's use-case is for editing human 
program source files, it assumes they are reasonably sized and loads the whole 
file and keeps style information for the whole file so it doesn't have to be 
regenerated all the time (hence twice the size).  If Geany's use-case was to 
open the biggest possible file it may be designed differently and would not use 
Scintilla.  That is unlikely to change.

In general its not possible to warn if a program is "running out of memory" 
before it does (ie an allocate fails) because that can depend on what else is 
using memory.  Its not even possible to report if a program is running out of 
address space (which is actually what the 32bit windows problem is) because 
many library functions use memory that Geany has no idea about.

The best we can do is as I posted above, don't crash/hang when an allocate 
fails (but obviously don't complete the operation that was happening) and let 
the user try saving their files, it may still work if the allocate that failed 
was very large and the files they want to save are small.

@codebrainz yeah, Geany does check the error return from 
`g_file_load_contents()` and simply does nothing if it fails :)

This issue is however intended to be solely about Scintilla status returns, but 
I'm sure more issues could be raised for other places return checks are missed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/1569#issuecomment-320130010

Reply via email to