From 4d7a5b6829dddae2de74744cb0222369924f206c Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 14 Nov 2024 11:49:42 +0100 Subject: [PATCH] base: add Attached_dataspace::clear() This alleviates the need (and risk) of manually parametrizing 'memset' whenever the entire dataspace shall be cleared. Issue #3897 --- repos/base/include/base/attached_ram_dataspace.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/repos/base/include/base/attached_ram_dataspace.h b/repos/base/include/base/attached_ram_dataspace.h index b04c654c46..1f641f06e9 100644 --- a/repos/base/include/base/attached_ram_dataspace.h +++ b/repos/base/include/base/attached_ram_dataspace.h @@ -139,6 +139,8 @@ class Genode::Attached_ram_dataspace */ size_t size() const { return _size; } + void clear() { if (_at) memset((void *)_at, 0, _size); } + void swap(Attached_ram_dataspace &other) { _swap(_size, other._size);