10 #ifndef K_API_MEMORY_H
11 #define K_API_MEMORY_H
14 #include <kApi/Io/kMemory.x.h>
Represents an in-memory stream.
Represents a 64-bit unsigned integer.
kStatus kMemory_Reserve(kMemory memory, kSize minimumCapacity)
Ensures that capacity is reserved for at least the specified number of bytes.
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
kStatus kMemory_Allocate(kMemory memory, kSize initialCapacity)
Allocates an auto-sizing, internally-managed buffer for the memory stream.
kStatus kMemory_Attach(kMemory memory, void *buffer, kSize position, kSize length, kSize capacity)
Attaches the memory stream to an external, fixed-capacity buffer.
kSize kMemory_Capacity(kMemory memory)
Returns the current capacity of the memory buffer.
void * kMemory_At(kMemory memory, kSize offset)
Returns a pointer to the memory buffer at the specified position.
Core Zen type declarations.
kStatus kMemory_Construct(kMemory *memory, kAlloc allocator)
Constructs a kMemory object.
k64u kMemory_Position(kMemory memory)
Returns the current position of the read/write pointer, relative to the beginning of the buffer...
Represents an error code.
k64u kMemory_Length(kMemory memory)
Returns the current length of the memory buffer.
kStatus kMemory_SetLength(kMemory memory, kSize length)
Sets the reported length of the memory buffer.