From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (unknown [IPv6:2602:4b:a4d8:4b00:12bf:48ff:fe7c:5584]) by hurricane.the-brannons.com (Postfix) with ESMTPSA id 6333F7842C for ; Fri, 7 Feb 2014 07:06:07 -0800 (PST) From: Chris Brannon To: Edbrowse-dev@lists.the-brannons.com References: <20140107090114.eklhad@comcast.net> Date: Fri, 07 Feb 2014 07:05:32 -0800 In-Reply-To: <20140107090114.eklhad@comcast.net> (Karl Dahlke's message of "Fri, 07 Feb 2014 09:01:14 -0500") Message-ID: <87zjm3ezer.fsf@mushroom.PK5001Z> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Edbrowse-dev] Error Legs X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 15:06:07 -0000 Karl Dahlke 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