add the missing memset builtin (#353)

Closes  #350

- Add the missing `memset` builtin which was accidentally deleted in a
previous PR.
- Add a compilation test to ensure the `memset` builtin is present.

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
xermicus
2025-06-28 12:01:34 +02:00
committed by GitHub
parent 486c9c28a1
commit 75fc23c810
5 changed files with 54 additions and 0 deletions
+7
View File
@@ -30,6 +30,13 @@ void * memmove(void *dst, const void *src, size_t n) {
return dst;
}
void * memset(void *b, int c, size_t len) {
uint8_t *dest = b;
uint8_t val = (uint8_t)c;
while (len-- > 0) *dest++ = val;
return b;
}
// Imports
POLKAVM_IMPORT(void, address, uint32_t)