KrkUpvalue Struct Reference

Storage for values referenced from nested functions. More...

#include <object.h>

Inheritance diagram for KrkUpvalue:

Public Member Functions

KrkUpvaluekrk_newUpvalue (int slot)
 Create an upvalue slot. More...

Data Fields

int location
 Stack offset or -1 if closed.
KrkValue closed
 Heap storage for closed value.
struct KrkUpvaluenext
 Invasive linked list pointer to next upvalue.
struct KrkThreadStateowner
 The thread that owns the stack this upvalue belongs in.
- 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

Detailed Description

Storage for values referenced from nested functions.

Definition at line 115 of file object.h.

Member Function Documentation

◆ krk_newUpvalue()

KrkUpvalue * krk_newUpvalue ( int  slot)

Create an upvalue slot.

Upvalue slots hold references to values captured in closures. This function should only be used directly by the VM in the process of running compiled bytecode and creating function objects from code objects.

Definition at line 315 of file object.c.

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