KrkBytes Struct Reference

Immutable sequence of bytes. More...

#include <object.h>

Inheritance diagram for KrkBytes:

Public Member Functions

KrkByteskrk_newBytes (size_t length, uint8_t *source)
 Create a new byte array. More...
 

Data Fields

size_t length
 Length of data in bytes.
 
uint8_t * bytes
 Pointer to separately-stored bytes data.
 
- Data Fields inherited from KrkObj
uint16_t type
 Tag indicating core type.
 
uint16_t flags
 General object flags, mostly related to garbage collection.
 
uint32_t hash
 Cached hash value for table keys.
 
struct KrkObjnext
 Invasive linked list of all objects in the VM.
 

Protected Attributes

KrkObj obj
 Base.
 

Detailed Description

Immutable sequence of bytes.

Definition at line 105 of file object.h.

Member Function Documentation

◆ krk_newBytes()

KrkBytes * krk_newBytes ( size_t  length,
uint8_t *  source 
)

Create a new byte array.

Allocates a bytes object of the given size, optionally copying data from source.

Definition at line 367 of file object.c.


The documentation for this struct was generated from the following file: