6#ifndef R_OBJECT_HELPER_H_
7#define R_OBJECT_HELPER_H_
14#define R_INTERNALS_UUID "2fdf6c18-697a-4ba7-b8ef-11c0d92f1327"
20 unsigned int type : 5;
21 unsigned int scalar : 1;
25 unsigned int mark : 1;
26 unsigned int debug : 1;
27 unsigned int trace : 1;
28 unsigned int spare : 1;
29 unsigned int gcgen : 1;
30 unsigned int gccls : 3;
31 unsigned int named : NAMED_BITS;
32 unsigned int extra : 32 - NAMED_BITS;
36#if INTPTR_MAX == INT64_MAX
37typedef int64_t R_xlen_t;
44 unsigned int type : 5;
46 unsigned int named : 2;
48 unsigned int mark : 1;
49 unsigned int debug : 1;
50 unsigned int trace : 1;
51 unsigned int spare : 1;
52 unsigned int gcgen : 1;
53 unsigned int gccls : 3;
96 struct LGBM_SER* gengc_next_node, *gengc_prev_node;
115 struct LGBM_SER* gengc_next_node, *gengc_prev_node;
121#define DATAPTR(x) (((SEXPREC_ALIGN *) (x)) + 1)
123#define R_CHAR_PTR(x) ((char *) DATAPTR(x))
125#define R_INT_PTR(x) ((int *) DATAPTR(x))
127#define R_INT64_PTR(x) ((int64_t *) DATAPTR(x))
129#define R_REAL_PTR(x) ((double *) DATAPTR(x))
131#define R_AS_INT(x) (*((int *) DATAPTR(x)))
133#define R_AS_INT64(x) (*((int64_t *) DATAPTR(x)))
135#define R_IS_NULL(x) ((*(LGBM_SE)(x)).sxpinfo.type == 0)
138#if INTPTR_MAX == INT64_MAX
140#define R_ADDR(x) ((int64_t *) DATAPTR(x))
142inline void R_SET_PTR(
LGBM_SE x,
void* ptr) {
143 if (ptr ==
nullptr) {
144 R_ADDR(x)[0] = (int64_t)(NULL);
146 R_ADDR(x)[0] = (int64_t)(ptr);
150inline void* R_GET_PTR(
LGBM_SE x) {
154 auto ret = (
void *)(R_ADDR(x)[0]);
164#define R_ADDR(x) ((int32_t *) DATAPTR(x))
166inline void R_SET_PTR(
LGBM_SE x,
void* ptr) {
167 if (ptr ==
nullptr) {
168 R_ADDR(x)[0] = (int32_t)(NULL);
170 R_ADDR(x)[0] = (int32_t)(ptr);
174inline void* R_GET_PTR(
LGBM_SE x) {
178 auto ret = (
void *)(R_ADDR(x)[0]);
Definition R_object_helper.h:93
Definition R_object_helper.h:112
Definition R_object_helper.h:81
Definition R_object_helper.h:75
Definition R_object_helper.h:69
Definition R_object_helper.h:59
Definition R_object_helper.h:87
Definition R_object_helper.h:43
Definition R_object_helper.h:63
Definition R_object_helper.h:107
Definition R_object_helper.h:119