Files
vystem/docs/shelter/std/mem.md
2026-03-31 22:15:00 +02:00

753 B

Basic memory operations

The Shelter standard library provide very basic memory operations primitives, defined in shelter/lib/include/std/mem.h and implemented inside shelter/lib/src/std/mem.c:

  • SH_STATUS sh_mem_compare(const void *a,const void *b,sh_uint64 size): compare two memory regions with the same size. Return SH_STATUS_SUCCESS if both regions are equal, or SH_STATUS_MEM_NOT_EQUAL if one byte is different.
  • SH_STATUS sh_mem_copy(const void *destination,const void *source,sh_uint64 size): copy one region of memory to another. Return SH_STATUS_SUCCESS
  • SH_STATUS sh_mem_set_8(sh_uint8 *ptr,const sh_uint8 byte,sh_uint64 count): set a provided amount of bytes to the value of one provided byte. Return SH_STATUS_SUCCESS