aboutsummaryrefslogtreecommitdiff
path: root/kernel/include/buffer.h
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2014-12-26 12:37:30 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2014-12-26 12:37:30 +0100
commita5dfdd2b3fa91a2cda4f807c88bd35928e3c7a61 (patch)
tree86bbe5558fe35b7263bd2c7859dfb9b4cb634073 /kernel/include/buffer.h
parent8c247352543c50204314efeb988f9f59d84f5019 (diff)
downloadkogata-a5dfdd2b3fa91a2cda4f807c88bd35928e3c7a61.tar.gz
kogata-a5dfdd2b3fa91a2cda4f807c88bd35928e3c7a61.zip
Owning... (old commit)
Diffstat (limited to 'kernel/include/buffer.h')
-rw-r--r--kernel/include/buffer.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/include/buffer.h b/kernel/include/buffer.h
index 577ceae..c47e2b4 100644
--- a/kernel/include/buffer.h
+++ b/kernel/include/buffer.h
@@ -7,6 +7,8 @@
// enabling the creation, sharing, slicing and concatenation of buffers
// without having to copy everything each time
+// Buffers are always allocated on the core kernel heap (kmalloc/kfree)
+
// Once a buffer is allocated, its contents is immutable
// Encoding and decoding functions for buffer contents are provided in
@@ -22,7 +24,7 @@ size_t buffer_len(buffer_t* buf);
size_t read_buffer(buffer_t* buf, char* to, size_t begin, size_t n); // returns num of bytes read
buffer_t* buffer_from_bytes(const char* data, size_t n); // bytes are COPIED
-buffer_t* buffer_from_bytes_nocopy(const char* data, size_t n); // bytes are NOT COPIED
+buffer_t* buffer_from_bytes_nocopy(const char* data, size_t n, bool own_bytes); // bytes are NOT COPIED
// these functions GIVE the buffer in order to create the new buffer, ie they do not increase RC
// the buffer is NOT GIVED if the new buffer could not be created (ie retval == 0)