Reduct  v4.0.5-1-g4851deb
A functional and immutable language.
Loading...
Searching...
No Matches
item.h File Reference

Item management. More...

#include <reduct/arena.h>
#include <reduct/atom.h>
#include <reduct/closure.h>
#include <reduct/defs.h>
#include <reduct/function.h>
#include <reduct/future.h>
#include <reduct/list.h>
#include <reduct/rvsdg.h>
#include <reduct/task.h>
Include dependency graph for item.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  reduct_item_t
 Item structure. More...
 
struct  reduct_item_block_t
 Item block structure. More...
 
struct  reduct_item_global_t
 Global item-related state structure. More...
 
struct  reduct_item_local_t
 Per-thread item-related state structure. More...
 

Macros

#define REDUCT_ITEM_TYPE_NONE   0
 No type.
 
#define REDUCT_ITEM_TYPE_ATOM   1
 An atom.
 
#define REDUCT_ITEM_TYPE_ARENA   2
 An arena.
 
#define REDUCT_ITEM_TYPE_LIST   3
 A list.
 
#define REDUCT_ITEM_TYPE_FUNCTION   4
 A function.
 
#define REDUCT_ITEM_TYPE_CLOSURE   5
 A closure.
 
#define REDUCT_ITEM_TYPE_RVSDG_NODE   6
 An IR node.
 
#define REDUCT_ITEM_TYPE_RVSDG_EDGE   7
 An IR edge.
 
#define REDUCT_ITEM_TYPE_RVSDG_REGION   8
 An IR region.
 
#define REDUCT_ITEM_TYPE_RVSDG_USER   9
 An IR user (input/result).
 
#define REDUCT_ITEM_TYPE_RVSDG_ORIGIN   10
 An IR origin (output/argument).
 
#define REDUCT_ITEM_TYPE_FUTURE   11
 A future.
 
#define REDUCT_ITEM_FLAG_NONE   0
 No flags.
 
#define REDUCT_ITEM_FLAG_MARKED   (1 << 0)
 Item is marked by the GC.
 
#define REDUCT_ITEM_FLAG_RETAINED   (1 << 1)
 Item is retained and should be considered a root by the GC.
 
#define REDUCT_ITEM_PAYLOAD_MAX   56
 The maximum size of the item payload.
 
#define REDUCT_ITEM_BLOCK_MAX   127
 The maximum number of items in a block.
 

Typedefs

typedef uint8_t reduct_item_type_t
 Item type enumeration.
 
typedef uint8_t reduct_item_flags_t
 Item flags enumeration.
 

Functions

REDUCT_API void reduct_item_global_init (reduct_item_global_t *global)
 Initialize a global item state.
 
REDUCT_API void reduct_item_global_deinit (struct reduct *reduct, reduct_item_global_t *global)
 Deinitialize a global item state.
 
REDUCT_API void reduct_item_local_init (reduct_item_local_t *local)
 Initialize a local item state.
 
REDUCT_API void reduct_item_local_deinit (reduct_item_local_t *local)
 Deinitialize a local item state.
 
REDUCT_API reduct_item_treduct_item_new (struct reduct *reduct)
 Allocate a new item.
 
REDUCT_API void reduct_item_deinit (struct reduct *reduct, reduct_item_t *item)
 Deinitialize a item without adding it to the freelist.
 
REDUCT_API void reduct_item_free (struct reduct *reduct, reduct_item_t *item)
 Free an item.
 
REDUCT_API const char * reduct_item_type_str (reduct_item_t *item)
 Get the string representation of the type of an item.
 
REDUCT_API void reduct_item_mark (reduct_item_t *item)
 Mark an item as reachable.
 
static REDUCT_ALWAYS_INLINE void reduct_item_retain (struct reduct_item *item)
 Retain an item, preventing it from being collected by the garbage collector.
 
static REDUCT_ALWAYS_INLINE void reduct_item_release (struct reduct_item *item)
 Release an item, potentially allowing the garbage collector to collect it.
 

Detailed Description

Item management.

Definition in file item.h.