Karl Dahlke <[email protected]> writes:

> The expedient approach is to wrapper some of the js calls,

It's even easier than that.  my_ErrorReporter gets a pointer to
JSErrorReport, which will tell us exactly what went wrong.  So we can
exit on out-of-memory inside my_ErrorReporter.  No wrappers, no other
error legs needed, I think.
Do a pull, and you'll see what I mean.

Now here are the open questions.  Do we need to be exiting on conditions
other than out-of-memory?  Maybe we do, and we don't know what they are
yet...

Also, this strategy is fine when a native C function, such as domLink,
fails to allocate.  However, if the out-of-memory condition happens in a
script, passed to JS_EvaluateScript, it is converted to a JavaScript
exception.  my_ErrorReporter will get called to indicate the failure,
but the failure will be converted to "uncaught exception: out of
memory", indicating that the script failed to catch the exception.
my_ErrorReporter will see an out-of-memory condition the next time a C
function fails to allocate.  Is this good enough?
Ideally, I'd like to know about out-of-memory during script evaluation,
rather than having it silently converted to a JS exception, but I don't
think we can do that.

Look  at my http://the-brannons.com/array.html example if the previous
paragraph is unclear.

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

Reply via email to