mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Move more from kutil to kernel
The moving of kernel-only code out of kutil continues. (See 042f061)
This commit moves the following:
- The heap allocator code
- memory.cpp/h which means:
- letting string.h be the right header for memset and memcpy, still
including an implementation of it for the kernel though, since
we're not linking libc to the kernel
- Changing calls to kalloc/kfree to new/delete in kutil containers
that aren't going to be merged into the kernel
- Fixing a problem with stdalign.h from libc, which was causing issues
for type_traits.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "kutil/assert.h"
|
||||
|
||||
#include "kernel_memory.h"
|
||||
@@ -38,7 +39,7 @@ channel::enqueue(size_t *len, const void *data)
|
||||
size_t avail = m_buffer.reserve(*len, &buffer);
|
||||
*len = *len > avail ? avail : *len;
|
||||
|
||||
kutil::memcpy(buffer, data, *len);
|
||||
memcpy(buffer, data, *len);
|
||||
m_buffer.commit(*len);
|
||||
|
||||
assert_signal(j6_signal_channel_can_recv);
|
||||
@@ -65,7 +66,7 @@ channel::dequeue(size_t *len, void *data)
|
||||
size_t avail = m_buffer.get_block(&buffer);
|
||||
*len = *len > avail ? avail : *len;
|
||||
|
||||
kutil::memcpy(data, buffer, *len);
|
||||
memcpy(data, buffer, *len);
|
||||
m_buffer.consume(*len);
|
||||
|
||||
assert_signal(j6_signal_channel_can_send);
|
||||
|
||||
Reference in New Issue
Block a user