/
gc_api.h
578 lines (500 loc) · 19.4 KB
/
gc_api.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
/* gc_api.h
* Copyright (C) 2001-2010, Parrot Foundation.
* Overview:
* Handles dead object destruction of the various headers
* History:
* Initial version by Mike Lambert on 2002.05.27
*/
#ifndef PARROT_GC_API_H_GUARD
#define PARROT_GC_API_H_GUARD
#include "parrot/parrot.h"
/*
* we need an alignment that is the same as malloc(3) have for
* allocating Buffer items like FLOATVAL (double)
* This should be either a config hint or tested
*/
#ifdef MALLOC_ALIGNMENT
# define BUFFER_ALIGNMENT MALLOC_ALIGNMENT
#else
/* or (2 * sizeof (size_t)) */
# define BUFFER_ALIGNMENT 8
#endif
#define BUFFER_ALIGN_1 (BUFFER_ALIGNMENT - 1)
#define BUFFER_ALIGN_MASK ~BUFFER_ALIGN_1
#define WORD_ALIGN_1 (sizeof (void *) - 1)
#define WORD_ALIGN_MASK ~WORD_ALIGN_1
#define ALIGNED_STRING_SIZE(len) (((len) + sizeof (void*) + WORD_ALIGN_1) & WORD_ALIGN_MASK)
#define PARROT_GC_WRITE_BARRIER(i, p) do { if (PObj_GC_need_write_barrier_TEST((p))) Parrot_gc_write_barrier((i), (p)); } while(0)
typedef struct _Parrot_GC_Init_Args {
void *stacktop;
const char *system;
Parrot_Float4 nursery_size;
Parrot_Int dynamic_threshold;
Parrot_Int min_threshold;
Parrot_UInt numthreads;
} Parrot_GC_Init_Args;
typedef enum _gc_sys_type_enum {
MS, /* mark and sweep */
INF, /* infinite memory core */
MS2,
GMS
} gc_sys_type_enum;
/* pool iteration */
typedef enum {
POOL_PMC = 0x01,
POOL_BUFFER = 0x02,
POOL_CONST = 0x04,
POOL_ALL = 0x07
} pool_iter_enum;
struct Memory_Block;
struct Var_Size_Pool;
struct Fixed_Size_Pool;
struct Fixed_Size_Arena;
struct Memory_Pools;
typedef enum {
GC_TRACE_FULL = 1,
GC_TRACE_ROOT_ONLY = 2,
GC_TRACE_SYSTEM_ONLY = 3
} Parrot_gc_trace_type;
typedef int (*pool_iter_fn)(PARROT_INTERP, struct Memory_Pools *, struct Fixed_Size_Pool *, int, void*);
typedef void (*add_free_object_fn_type)(PARROT_INTERP, struct Memory_Pools *, struct Fixed_Size_Pool *, void *);
typedef void * (*get_free_object_fn_type)(PARROT_INTERP, struct Memory_Pools *, struct Fixed_Size_Pool *);
typedef void (*alloc_objects_fn_type)(PARROT_INTERP, struct Memory_Pools *, struct Fixed_Size_Pool *);
typedef void (*gc_object_fn_type)(PARROT_INTERP, ARGMOD(struct Memory_Pools *),
ARGIN(struct Fixed_Size_Pool *), ARGMOD(PObj *));
/* &gen_from_enum(interpinfo.pasm) prefix(INTERPINFO_) */
typedef enum {
TOTAL_MEM_ALLOC = 1,
TOTAL_MEM_USED,
GC_MARK_RUNS,
GC_COLLECT_RUNS,
ACTIVE_PMCS,
ACTIVE_BUFFERS,
TOTAL_PMCS,
TOTAL_BUFFERS,
HEADER_ALLOCS_SINCE_COLLECT,
MEM_ALLOCS_SINCE_COLLECT,
TOTAL_COPIED,
IMPATIENT_PMCS,
GC_LAZY_MARK_RUNS,
EXTENDED_PMCS,
CURRENT_RUNCORE,
PARROT_INTSIZE,
PARROT_FLOATSIZE,
PARROT_POINTERSIZE,
PARROT_INTMAX,
PARROT_INTMIN,
/* interpinfo_p constants */
CURRENT_CTX,
CURRENT_SUB,
CURRENT_CONT,
CURRENT_LEXPAD,
CURRENT_TASK,
/* interpinfo_s constants */
EXECUTABLE_FULLNAME,
EXECUTABLE_BASENAME,
RUNTIME_PREFIX,
GC_SYS_NAME,
PARROT_OS,
PARROT_OS_VERSION,
PARROT_OS_VERSION_NUMBER,
CPU_ARCH,
CPU_TYPE
} Interpinfo_enum;
/* &end_gen */
#define GC_trace_stack_FLAG (UINTVAL)(1 << 1) /* trace system areas and stack */
#define GC_trace_normal_FLAG (UINTVAL)(1 << 1) /* the same */
#define GC_lazy_FLAG (UINTVAL)(1 << 2) /* timely destruction run */
#define GC_finish_FLAG (UINTVAL)(1 << 3) /* on Parrot exit: mark (almost) all PMCs dead and */
#define GC_strings_cb_FLAG (UINTVAL)(1 << 4) /* Invoked from String GC during mem_alloc to sweep dead strings */
/* garbage collect. */
/* HEADERIZER BEGIN: src/gc/api.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
PARROT_EXPORT
void Parrot_block_GC_mark(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_block_GC_mark_locked(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_block_GC_sweep(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
int Parrot_gc_active_pmcs(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
int Parrot_gc_active_sized_buffers(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP,
ARGOUT(Parrot_Buffer *buffer),
size_t size)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*buffer);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void * Parrot_gc_allocate_fixed_size_storage(PARROT_INTERP, size_t size)
__attribute__nonnull__(1);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void * Parrot_gc_allocate_memory_chunk(PARROT_INTERP, size_t size)
__attribute__nonnull__(1);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void * Parrot_gc_allocate_memory_chunk_with_interior_pointers(PARROT_INTERP,
size_t size)
__attribute__nonnull__(1);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void * Parrot_gc_allocate_pmc_attributes(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*pmc);
PARROT_EXPORT
void Parrot_gc_allocate_string_storage(PARROT_INTERP,
ARGOUT(STRING *str),
size_t size)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*str);
PARROT_EXPORT
void Parrot_gc_compact_memory_pool(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_completely_unblock(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
size_t Parrot_gc_count_collect_runs(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
size_t Parrot_gc_count_lazy_mark_runs(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
size_t Parrot_gc_count_mark_runs(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_destroy_child_interp(
ARGMOD(Interp *dest_interp),
ARGIN(Interp *source_interp))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*dest_interp);
PARROT_EXPORT
void Parrot_gc_finalize(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_free_bufferlike_header(PARROT_INTERP,
ARGMOD(Parrot_Buffer *obj),
size_t size)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*obj);
PARROT_EXPORT
void Parrot_gc_free_fixed_size_storage(PARROT_INTERP,
size_t size,
ARGMOD(void *data))
__attribute__nonnull__(1)
__attribute__nonnull__(3)
FUNC_MODIFIES(*data);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void Parrot_gc_free_memory_chunk(PARROT_INTERP, ARGIN_NULLOK(void *data))
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_free_pmc_attributes(PARROT_INTERP, ARGFREE(PMC *pmc))
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_free_pmc_header(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*pmc);
PARROT_EXPORT
void Parrot_gc_free_string_header(PARROT_INTERP, ARGMOD(STRING *s))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*s);
PARROT_EXPORT
size_t Parrot_gc_headers_alloc_since_last_collect(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
UINTVAL Parrot_gc_impatient_pmcs(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_initialize(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *args))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
PARROT_EXPORT
void Parrot_gc_mark_and_sweep(PARROT_INTERP, UINTVAL flags)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_mark_PMC_alive_fun(PARROT_INTERP, ARGMOD_NULLOK(PMC *obj))
__attribute__nonnull__(1)
FUNC_MODIFIES(*obj);
PARROT_EXPORT
void Parrot_gc_mark_PObj_alive(PARROT_INTERP, ARGMOD(PObj *obj))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*obj);
PARROT_EXPORT
void Parrot_gc_mark_STRING_alive_fun(PARROT_INTERP,
ARGMOD_NULLOK(STRING *obj))
__attribute__nonnull__(1)
FUNC_MODIFIES(*obj);
PARROT_EXPORT
size_t Parrot_gc_mem_alloc_since_last_collect(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
Parrot_Buffer * Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size)
__attribute__nonnull__(1);
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PMC * Parrot_gc_new_pmc_header(PARROT_INTERP, UINTVAL flags)
__attribute__nonnull__(1);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
STRING * Parrot_gc_new_string_header(PARROT_INTERP, UINTVAL flags)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_pmc_needs_early_collection(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*pmc);
PARROT_EXPORT
void Parrot_gc_reallocate_buffer_storage(PARROT_INTERP,
ARGMOD(Parrot_Buffer *buffer),
size_t newsize)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*buffer);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void * Parrot_gc_reallocate_memory_chunk(PARROT_INTERP,
ARGFREE(void *data),
size_t newsize)
__attribute__nonnull__(1);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void * Parrot_gc_reallocate_memory_chunk_with_interior_pointers(PARROT_INTERP,
ARGFREE(void *data),
size_t newsize,
size_t oldsize)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_reallocate_string_storage(PARROT_INTERP,
ARGMOD(STRING *str),
size_t newsize)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*str);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
STRING * Parrot_gc_sys_name(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
UINTVAL Parrot_gc_total_copied(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
size_t Parrot_gc_total_memory_allocated(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
size_t Parrot_gc_total_memory_used(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
int Parrot_gc_total_pmcs(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
int Parrot_gc_total_sized_buffers(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_gc_write_barrier(PARROT_INTERP, ARGIN(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
PARROT_EXPORT
unsigned int Parrot_is_blocked_GC_mark(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
unsigned int Parrot_is_blocked_GC_sweep(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_unblock_GC_mark(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_unblock_GC_mark_locked(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
void Parrot_unblock_GC_sweep(PARROT_INTERP)
__attribute__nonnull__(1);
#define ASSERT_ARGS_Parrot_block_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_block_GC_mark_locked __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_block_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_active_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_active_sized_buffers \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_allocate_buffer_storage_aligned \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(buffer))
#define ASSERT_ARGS_Parrot_gc_allocate_fixed_size_storage \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_allocate_memory_chunk \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_allocate_memory_chunk_with_interior_pointers \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_allocate_pmc_attributes \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_Parrot_gc_allocate_string_storage \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(str))
#define ASSERT_ARGS_Parrot_gc_compact_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_completely_unblock __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_count_collect_runs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_count_lazy_mark_runs \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_count_mark_runs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_destroy_child_interp \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(dest_interp) \
, PARROT_ASSERT_ARG(source_interp))
#define ASSERT_ARGS_Parrot_gc_finalize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_free_bufferlike_header \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(obj))
#define ASSERT_ARGS_Parrot_gc_free_fixed_size_storage \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(data))
#define ASSERT_ARGS_Parrot_gc_free_memory_chunk __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_free_pmc_attributes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_free_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_Parrot_gc_free_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_Parrot_gc_headers_alloc_since_last_collect \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_impatient_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_initialize __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(args))
#define ASSERT_ARGS_Parrot_gc_mark_and_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_mark_PMC_alive_fun __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_mark_PObj_alive __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(obj))
#define ASSERT_ARGS_Parrot_gc_mark_STRING_alive_fun \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_mem_alloc_since_last_collect \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_new_bufferlike_header \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_new_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_new_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_pmc_needs_early_collection \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_Parrot_gc_reallocate_buffer_storage \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(buffer))
#define ASSERT_ARGS_Parrot_gc_reallocate_memory_chunk \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_reallocate_memory_chunk_with_interior_pointers \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_reallocate_string_storage \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(str))
#define ASSERT_ARGS_Parrot_gc_sys_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_total_copied __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_total_memory_allocated \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_total_memory_used __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_total_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_total_sized_buffers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_gc_write_barrier __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_Parrot_is_blocked_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_is_blocked_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_unblock_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_unblock_GC_mark_locked __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_unblock_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/gc/api.c */
# define Parrot_gc_mark_STRING_alive(interp, obj) Parrot_gc_mark_STRING_alive_fun((interp), (obj))
#if defined(PARROT_IN_CORE)
#ifdef THREAD_DEBUG
# define Parrot_gc_mark_PMC_alive(interp, obj) \
do if (!PMC_IS_NULL(obj) \
&& (!PObj_is_shared_TEST(obj) || !Interp_flags_TEST((interp), PARROT_IS_THREAD))) { \
PARROT_ASSERT((obj)->orig_interp == (interp)); \
Parrot_gc_mark_PMC_alive_fun((interp), (obj)); \
} \
while (0)
#else
# define Parrot_gc_mark_PMC_alive(interp, obj) \
do if (!PMC_IS_NULL(obj) \
&& (!PObj_is_shared_TEST(obj) || !Interp_flags_TEST((interp), PARROT_IS_THREAD))) { \
Parrot_gc_mark_PMC_alive_fun((interp), (obj)); \
} \
while (0)
#endif
#else
# define Parrot_gc_mark_PMC_alive(interp, obj) Parrot_gc_mark_PMC_alive_fun((interp), (obj))
#endif
#endif /* PARROT_GC_API_H_GUARD */
/*
* Local variables:
* c-file-style: "parrot"
* End:
* vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
*/