ports/www/chromium/files/patch-base_process_memory__linux.cc
Robert Nagy acb70e0682 www/chromium: update to 127.0.6533.88
This update also removes the --audio-backend command line switch
in favor of an actual setting in the browser that can be changed
at chrome://flags/#audio-backend

Security:	https://vuxml.freebsd.org/freebsd/15d398ea-4f73-11ef-8a0f-a8a1599412c6.html
2024-07-31 21:32:46 +02:00

44 lines
1.4 KiB
C++

--- base/process/memory_linux.cc.orig 2024-07-30 11:12:21 UTC
+++ base/process/memory_linux.cc
@@ -28,6 +28,7 @@ void __libc_free(void*);
namespace base {
+#if !BUILDFLAG(IS_BSD)
namespace {
void ReleaseReservationOrTerminate() {
@@ -37,12 +38,14 @@ void ReleaseReservationOrTerminate() {
}
} // namespace
+#endif
void EnableTerminationOnHeapCorruption() {
// On Linux, there nothing to do AFAIK.
}
void EnableTerminationOnOutOfMemory() {
+#if !BUILDFLAG(IS_BSD)
// Set the new-out of memory handler.
std::set_new_handler(&ReleaseReservationOrTerminate);
// If we're using glibc's allocator, the above functions will override
@@ -51,8 +54,10 @@ void EnableTerminationOnOutOfMemory() {
#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
allocator_shim::SetCallNewHandlerOnMallocFailure(true);
#endif
+#endif
}
+#if !BUILDFLAG(IS_BSD)
// ScopedAllowBlocking() has private constructor and it can only be used in
// friend classes/functions. Declaring a class is easier in this situation to
// avoid adding more dependency to thread_restrictions.h because of the
@@ -110,6 +115,7 @@ bool AdjustOOMScoreHelper::AdjustOOMScore(ProcessId pr
bool AdjustOOMScore(ProcessId process, int score) {
return AdjustOOMScoreHelper::AdjustOOMScore(process, score);
}
+#endif
bool UncheckedMalloc(size_t size, void** result) {
#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)