//----------------------------------------------------------------------------// // GNU GPL OS/K // // // // Authors: spectral` // // NeoX // // // // Desc: mem*() functions // //----------------------------------------------------------------------------// #include "common/memory.h" // // Set "bytes"-many bytes starting from ptr to val // void *memset(void *ptr, register int val, register size_t bytes) { uchar uval = val & 0xFF; uchar *uptr = (uchar *)ptr; while (bytes--) *uptr++ = uval; return ptr; } // // Set "bytes"-many bytes starting from ptr to 0 // void *memzero(void *ptr, size_t bytes) { uchar *uptr = (uchar *)ptr; while (bytes--) *uptr++ = 0; return ptr; }