ports/devel/electron35/files/patch-base_process_memory__linux.cc
Hiroki Tagato 3fe2f64857 devel/electron35: add port: Build cross-platform desktop apps with JavaScript, HTML, and CSS
Build cross platform desktop apps with JavaScript, HTML, and CSS.

It's easier than you think.

If you can build a website, you can build a desktop app. Electron is a
framework for creating native applications with web technologies like
JavaScript, HTML, and CSS. It takes care of the hard parts so you can
focus on the core of your application.

WWW: https://electronjs.org/
2025-04-08 21:01:02 +09:00

44 lines
1.3 KiB
C++

--- base/process/memory_linux.cc.orig 2025-03-24 20:50:14 UTC
+++ base/process/memory_linux.cc
@@ -28,6 +28,7 @@ namespace base {
namespace base {
+#if !BUILDFLAG(IS_BSD)
namespace {
void ReleaseReservationOrTerminate() {
@@ -38,12 +39,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
@@ -52,8 +55,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
@@ -111,6 +116,7 @@ bool AdjustOOMScore(ProcessId process, int score) {
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)