KrkInstance Struct Reference
An object of a class. More...
#include <object.h>
Inheritance diagram for KrkInstance:
Public Member Functions | |
KrkInstance * | krk_newInstance (KrkClass *_class) |
Create a new instance of the given class. More... | |
Data Fields | |
KrkClass * | _class |
Type. | |
KrkTable | fields |
Attributes table. | |
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 KrkObj * | next |
Invasive linked list of all objects in the VM. | |
Protected Attributes | |
KrkObj | obj |
Base. | |
Detailed Description
An object of a class.
Created by class initializers, instances are the standard type of objects built by managed code. Not all objects are instances, but all instances are objects, and all instances have well-defined class.
Member Function Documentation
◆ krk_newInstance()
KrkInstance * krk_newInstance | ( | KrkClass * | _class | ) |
Create a new instance of the given class.
Handles allocation, but not init, of the new instance. Be sure to populate any fields expected by the class or call its init function (eg. with krk_callStack) as needed.
The documentation for this struct was generated from the following file:
- src/kuroko/object.h