> exit on out-of-memory inside my_ErrorReporter.

Very good.
I pushed a small change to use the symbol and message we already had for this
condition, rather than making a new one.
I try to avoid extra messages, as they have to be translated.
When you do add a message though, append zeros for the other languages,
just so I can keep track of outstanding messages that haven't yet been
translated into this or that.

Yes, as you point out we could exit on

if(stringEqual(message, "out of memory")

I'm thinking maybe not though.
Marching on won't lead to a segfault,
and as Adam notes, another buffer may have a lot of work in it,
so why exit.
It's not worse or better than the other js errors,
like undefined variable.
Of course, if truly out of memory,
the next js get object call will probably fail,
and that one will probably exit.
So maybe

if(stringEqual(message, "out of memory")) {
print some helpful warning about memory and risk of exit
and saving your buffers.
}

Your demo program is simple,
but I would point out that it doesn't fail if you replace {} with 37.
An array with a million elements still fits,
but an array of a million arrays, with all the associated overhead
of all those objects, that doesn't fit.
Hard to imagine a web page making a million arrays.
So it makes me wonder if we ever bump up against this limit
on a real website.
Are we jumping at shadows, or is this really an issue?
If 4 meg isn't enough, 16y probably is.
My gut tells me the segfaults might come from somewhere else.
Then again, you could have many web pages, with many
contexts and pages, in one edbrowse session.
IDK


Karl Dahlke
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev

Reply via email to