From 98ad3282c12a868a7dc33d56ae2363d6ef98ed0c Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 16 Mar 2016 12:10:13 -0400 Subject: [PATCH] Stubs from memory utilities --- src/kstd/Memory.cc | 39 +++++++++++++++++++++++++++++++++++++++ src/kstd/Memory.hh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 src/kstd/Memory.cc create mode 100644 src/kstd/Memory.hh diff --git a/src/kstd/Memory.cc b/src/kstd/Memory.cc new file mode 100644 index 0000000..65806b0 --- /dev/null +++ b/src/kstd/Memory.cc @@ -0,0 +1,39 @@ +/* Memory.cc + * vim: set tw=80: + * Eryn Wells + */ +/** + * Basic, low-level memory utilities. + */ + +namespace kstd { +namespace Memory { + +void * +copy(void *to, + const void *from, + size_t length) +{ } + + +void * +move(void *to, + const void *from, + size_t length) +{ } + + +void * +zero(void *s, + size_t length) +{ } + + +void * +set(void *s, + uint8_t value, + size_t length) +{ } + +} /* namespace Memory */ +} /* namespace kstd */ diff --git a/src/kstd/Memory.hh b/src/kstd/Memory.hh new file mode 100644 index 0000000..4aa4878 --- /dev/null +++ b/src/kstd/Memory.hh @@ -0,0 +1,30 @@ +/* Memory.hh + * vim: set tw=80: + * Eryn Wells + */ +/** + * Basic, low-level memory utilities. + */ + +#ifndef __MEMORY_HH__ +#define __MEMORY_HH__ + +namespace kstd { +namespace Memory { + +/** Copy `length` bytes from `from` to `to`. */ +void *copy(void *to, const void *from, size_t length); + +/** Move `length` bytes from `from` to `to`. */ +void *move(void *to, const void *from, size_t length); + +/** Set `length` bytes starting at `s` to zero. */ +void *zero(void *s, size_t length); + +/** Set `length` bytes starting at `s` to `value`. */ +void *set(void *s, uint8_t value, size_t length); + +} /* namespace Memory */ +} /* namespace kstd */ + +#endif /* __MEMORY_HH__ */