mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 00:31:02 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user