mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-10-26 21:49:52 +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:
1 parent
486c9c28a1
commit
75fc23c810
5 files changed
+54
No files matched your search
@@ -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