mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Add simple vector implementation to kutil for device_manager
This commit is contained in:
@@ -8,8 +8,20 @@ using addr_t = uint64_t;
|
||||
|
||||
namespace kutil {
|
||||
|
||||
/// Fill memory with the given value.
|
||||
/// \arg p The beginning of the memory area to fill
|
||||
/// \arg v The byte value to fill memory with
|
||||
/// \arg n The size in bytes of the memory area
|
||||
/// \returns A pointer to the filled memory
|
||||
void * memset(void *p, uint8_t v, size_t n);
|
||||
|
||||
/// Copy an area of memory to another
|
||||
/// \dest The memory to copy to
|
||||
/// \src The memory to copy from
|
||||
/// \n The number of bytes to copy
|
||||
/// \returns A pointer to the destination memory
|
||||
void * memcpy(void *dest, void *src, size_t n);
|
||||
|
||||
template <typename T>
|
||||
inline T read_from(const void *p) { return *reinterpret_cast<const T *>(p); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user