Skip to content
Snippets Groups Projects
  • Gunar Schorcht's avatar
    2215f298
    cpu/esp32: add memset that cannot be optimized out · 2215f298
    Gunar Schorcht authored
    Adds a memset function `system_secure_memset` which cannot be optimized out by the compiler. It uses the libsodium approach of weak symbols. Function system_secure_memset calls the standard memset. Calling an empty function declared with weak attribute after the memset call, prevents the compiler to optimize it out. The overhead is only one function call.
    2215f298
    History
    cpu/esp32: add memset that cannot be optimized out
    Gunar Schorcht authored
    Adds a memset function `system_secure_memset` which cannot be optimized out by the compiler. It uses the libsodium approach of weak symbols. Function system_secure_memset calls the standard memset. Calling an empty function declared with weak attribute after the memset call, prevents the compiler to optimize it out. The overhead is only one function call.