commit | f6e6c27cf516acda32c36241ec1d2b2001c5bbfe | [log] [tgz] |
---|---|---|
author | Torne (Richard Coles) <[email protected]> | Tue Jan 26 16:58:40 2021 |
committer | Chromium LUCI CQ <[email protected]> | Tue Jan 26 16:58:40 2021 |
tree | 56b6d0b3c74d7b83f6c296d93c72687f402b279c | |
parent | 7c86aa92ec42a2376279c77001cf0815d5e836f9 [diff] |
Simplify OOM handling. Most OOM conditions in Chromium are expected to crash, but there were multiple different code paths for this depending on the platform and the allocator being used, giving slightly different kinds of crash/output. Various shim functions had also been kept in the code for the benefit of the crash server, which uses a list of known OOM-handling function names to classify stack frames. This CL simplifies things significantly and retains almost all functionality: - base::TerminateBecauseOutOfMemory() is the canonical function to trigger an OOM crash. base::internal::OnNoMemoryInternal() has been removed from base's public API (though the function still exists). - g_oom_size has been moved from memory_linux.cc to memory.cc; it's not actually read on other platforms but setting it unconditionally simplifies the code and the cost is negligible. - memory_win.cc no longer defines its own versions of TerminateBecauseOutOfMemory or OnNoMemory as they weren't actually different to the generic versions. - memory_linux.cc no longer defines its own versions of OnNoMemory or OnNoMemorySize. They used to LOG(FATAL) instead of simply crashing as the generic versions did; this has been removed as it was only used for some OOM failures and not others, even on Linux, and the differing results were confusing. (e.g. PartitionAlloc failures did not use this codepath) - All these OOM functions now ultimately reach base::internal::OnNoMemoryInternal() and crash there. This is NOINLINE and has been recognised by the crash server as an OOM function for a considerable time; none of the other NOINLINE function names should be needed any more. Change-Id: Iabb7ba9f1dba7fe8eca5c754d1b6b0216ad452bd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643366 Reviewed-by: Nico Weber <[email protected]> Reviewed-by: Primiano Tucci <[email protected]> Commit-Queue: Richard Coles <[email protected]> Cr-Commit-Position: refs/heads/master@{#847197}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.