From ccdbefd1581254f858f4c20e872b867f192122b1 Mon Sep 17 00:00:00 2001 From: Benjamin Lamowski Date: Tue, 10 Dec 2024 11:30:23 +0100 Subject: [PATCH] base: make Ram_allocator noncopyable Prevent erratic runtime behavior stemming from accidentally passing a copy to a `Ram_allocator` by making the interface noncopyable. Issue #5221 --- repos/base/include/base/ram_allocator.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repos/base/include/base/ram_allocator.h b/repos/base/include/base/ram_allocator.h index a11d3f6a4d..f61add9709 100644 --- a/repos/base/include/base/ram_allocator.h +++ b/repos/base/include/base/ram_allocator.h @@ -19,6 +19,7 @@ #include #include #include +#include namespace Genode { @@ -32,7 +33,7 @@ namespace Genode { } -struct Genode::Ram_allocator : Interface +struct Genode::Ram_allocator : Interface, Noncopyable { enum class Alloc_error { OUT_OF_RAM, OUT_OF_CAPS, DENIED };