Parcel/utility/src/memory.c

30 lines
715 B
C

#include <utility.h>
void pac_memory_copy(void *destination, void *source, usz_t length)
{
u8_t *source_8 = source;
u8_t *destination_8 = destination;
usz_t index = 0;
while(index < length)
{
destination_8[index] = source_8[index];
++index;
}
}
void pac_memory_fill(void *region, usz_t len_region, u8_t byte)
{
u8_t *region_8 = region;
usz_t index = 0;
while(index < len_region)
{
region_8[index] = byte;
++index;
}
}
void pac_memory_zero(void *region, usz_t len_region)
{
pac_memory_fill(region, len_region, 0);
}