base: add Attached_dataspace::clear()

This alleviates the need (and risk) of manually parametrizing 'memset'
whenever the entire dataspace shall be cleared.

Issue #3897
This commit is contained in:
Norman Feske 2024-11-14 11:49:42 +01:00 committed by Christian Helmuth
parent 7019b795a6
commit 4d7a5b6829

View File

@ -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);