Ruby 4.1.0dev (2026-03-23 revision f8459601271ebbc5e1efb101387da955ed1faabb)
constant_pool.h
Go to the documentation of this file.
1
10#ifndef PRISM_CONSTANT_POOL_H
11#define PRISM_CONSTANT_POOL_H
12
16
17#include "prism/arena.h"
18
19#include <stddef.h>
20#include <stdint.h>
21
25typedef uint32_t pm_constant_id_t;
26
30typedef struct {
32 size_t size;
33
35 size_t capacity;
36
40
43
48
56
64
71
80
81#endif
A bump allocator for the prism parser.
PRISM_EXPORTED_FUNCTION void pm_constant_id_list_init(pm_constant_id_list_t *list) PRISM_NONNULL(1)
Initialize a list of constant ids.
PRISM_EXPORTED_FUNCTION const uint8_t * pm_constant_start(const pm_constant_t *constant) PRISM_NONNULL(1)
Return a raw pointer to the start of a constant.
PRISM_EXPORTED_FUNCTION void pm_constant_id_list_append(pm_arena_t *arena, pm_constant_id_list_t *list, pm_constant_id_t id) PRISM_NONNULL(1
Append a constant id to a list of constant ids.
uint32_t pm_constant_id_t
A constant id is a unique identifier for a constant in the constant pool.
PRISM_EXPORTED_FUNCTION size_t pm_constant_length(const pm_constant_t *constant) PRISM_NONNULL(1)
Return the length of a constant.
#define PRISM_EXPORTED_FUNCTION
By default, we compile with -fvisibility=hidden.
Definition exported.h:20
#define PRISM_NONNULL(...)
Mark the parameters of a function as non-null.
Definition nonnull.h:13
A list of constant IDs.
size_t size
The number of constant ids in the list.
size_t capacity
The number of constant ids that have been allocated in the list.
pm_constant_id_t * ids
The constant ids in the list.