On 29 Apr 2015, at 9:39am, Scott Robison <scott at casaderobison.com> wrote:
> On windows, malloc returns null if the allocation fails. Sqlite detects > this and returns an error. > > On linux, malloc may return a non null yet invalid pointer and only fail > when the memory is accessed because it wasn't really available. > > If Sqlite is not at fault when posix APIs lie about file locking, I don't > think Sqlite is responsible when malloc lies about what should be > considered a failed memory allocation which should return null. Okay, I see your distinction. Yes, Linux is lying about malloc having succeeded. And there's no further way to check the block it handed back apart from trying to use it, which triggers the error. A program can't do anything about a lying OS, so SQLite is not at fault. Simon.