From d19b7516322682aae8252de0138f3a6f41c52cd7 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 6 May 2021 13:19:13 +0200 Subject: [PATCH] nano3d: remove surface-clear optimization This patch fixes a GCC-10 compile error. Even though the optimization was quite effective - I measured a speedup of factor 2 - it is not all that important for the overall application performance. In the nano3d case, we are talking about 1 vs. 2 percent of CPU time. Fixes #4140 --- repos/gems/include/nano3d/scene.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/gems/include/nano3d/scene.h b/repos/gems/include/nano3d/scene.h index 61a0d703e1..8aef5ea297 100644 --- a/repos/gems/include/nano3d/scene.h +++ b/repos/gems/include/nano3d/scene.h @@ -165,9 +165,9 @@ class Nano3d::Scene template void _clear(Genode::Surface &surface) { - Genode::size_t n = (surface.size().count()*sizeof(T))/sizeof(long); - for (long *dst = (long *)surface.addr(); n--; dst++) - *dst = 0; + Genode::size_t n = surface.size().count(); + for (T *dst = surface.addr(); n--; dst++) + *dst = { }; } void clear()