2 ms·
> in low memory conditions That's why Firefox is switching to "infallible memory allocation" [1]. It's okay for Firefox to do that because Firefox is a top-lev
by quotemstr 12y ago
> in low memory conditions
That's why Firefox is switching to "infallible memory allocation" [1]. It's okay for Firefox to do that because Firefox is a top-level application, not a damn OS kernel.
[1] https://developer.mozilla.org/en-US/docs/Infallible_memory_allocation https://developer.mozilla.org/en-US/docs/Infallible_memory_a...
- mccr8 12y ago"new" is already infallible by default in Firefox. Most places outside of the JS engine are using infallible allocation, and have been for a number of years. The basic problem is that error handling for tiny allocations is unlikely to be ever tested, and thus have potentially critical security bugs. This is not merely a theoretical concern: one of the Pwn2Own exploits for Firefox last year relied on an error in some OOM handling code, resulting in remote code execution. Instead, Firefox just crashes if an allocation fails (in most places), and Mozilla gets a crash report. If a particular allocation fails enough, usually due to being a large allocation, then it will show up in our crash statistics, and that particular location can be made fallible. The error handling code is thus being run at least sometimes, making it a little safer.