File: gc.rbinc

package info (click to toggle)
ruby3.4 3.4.5-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 154,784 kB
  • sloc: ruby: 1,259,653; ansic: 829,955; yacc: 28,233; pascal: 7,359; sh: 3,864; python: 1,799; cpp: 1,158; asm: 808; makefile: 801; javascript: 414; lisp: 109; perl: 62; awk: 36; sed: 4; xml: 4
file content (115 lines) | stat: -rw-r--r-- 4,444 bytes parent folder | download
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
// -*- c -*-
// DO NOT MODIFY THIS FILE DIRECTLY.
// auto-generated file
//   by ./tool/mk_builtin_loader.rb
//   with gc.rb
#include "internal/compilers.h"     /* for MAYBE_UNUSED */
#include "internal/warnings.h"      /* for COMPILER_WARNING_PUSH */
#include "ruby/ruby.h"              /* for VALUE */
#include "builtin.h"                /* for RB_BUILTIN_FUNCTION */
struct rb_execution_context_struct; /* in vm_core.h */

static VALUE builtin_inline_class_321(struct rb_execution_context_struct *ec, const VALUE self)
{
VALUE *const hash__ptr = (VALUE *)&ec->cfp->ep[-3];
MAYBE_UNUSED(const VALUE) hash = *hash__ptr;
#line 321 "gc.rb"
return RBOOL(RB_TYPE_P(hash, T_HASH));
#line 18 "gc.rbinc"
}

static VALUE builtin_inline_class_349(struct rb_execution_context_struct *ec, const VALUE self)
{
VALUE *const hash_or_key__ptr = (VALUE *)&ec->cfp->ep[-3];
MAYBE_UNUSED(const VALUE) hash_or_key = *hash_or_key__ptr;
#line 349 "gc.rb"
return RBOOL(!SYMBOL_P(hash_or_key) && !RB_TYPE_P(hash_or_key, T_HASH));
#line 26 "gc.rbinc"
}

static VALUE builtin_inline_class_353(struct rb_execution_context_struct *ec, const VALUE self)
{
VALUE *const hash_or_key__ptr = (VALUE *)&ec->cfp->ep[-3];
MAYBE_UNUSED(const VALUE) hash_or_key = *hash_or_key__ptr;
#line 353 "gc.rb"

      return rb_gc_latest_gc_info(hash_or_key);
#line 35 "gc.rbinc"
}

static VALUE builtin_inline_class_365(struct rb_execution_context_struct *ec, const VALUE self)
{
VALUE *const flag__ptr = (VALUE *)&ec->cfp->ep[-3];
MAYBE_UNUSED(const VALUE) flag = *flag__ptr;
#line 365 "gc.rb"

      rb_gc_impl_set_measure_total_time(rb_gc_get_objspace(), flag);
      return flag;
#line 45 "gc.rbinc"
}

static VALUE builtin_inline_class_377(struct rb_execution_context_struct *ec, const VALUE self)
{
#line 377 "gc.rb"
return 
      RBOOL(rb_gc_impl_get_measure_total_time(rb_gc_get_objspace()));
#line 53 "gc.rbinc"
}

static VALUE builtin_inline_class_387(struct rb_execution_context_struct *ec, const VALUE self)
{
#line 387 "gc.rb"
return 
      ULL2NUM(rb_gc_impl_get_total_time(rb_gc_get_objspace()));
#line 61 "gc.rbinc"
}

void Init_builtin_gc(void)
{
  // table definition
  static const struct rb_builtin_function gc_table[] = {
    RB_BUILTIN_FUNCTION(0, gc_start_internal, gc_start_internal, 4),
    RB_BUILTIN_FUNCTION(1, gc_enable, gc_enable, 0),
    RB_BUILTIN_FUNCTION(2, gc_disable, gc_disable, 0),
    RB_BUILTIN_FUNCTION(3, gc_stress_get, gc_stress_get, 0),
    RB_BUILTIN_FUNCTION(4, gc_stress_set_m, gc_stress_set_m, 1),
    RB_BUILTIN_FUNCTION(5, gc_count, gc_count, 0),
    RB_BUILTIN_FUNCTION(6, gc_stat, gc_stat, 1),
    RB_BUILTIN_FUNCTION(7, gc_stat_heap, gc_stat_heap, 2),
    RB_BUILTIN_FUNCTION(8, gc_config_get, gc_config_get, 0),
    RB_BUILTIN_FUNCTION(9, _bi321, builtin_inline_class_321, 0),
    RB_BUILTIN_FUNCTION(10, gc_config_set, gc_config_set, 1),
    RB_BUILTIN_FUNCTION(11, _bi349, builtin_inline_class_349, 0),
    RB_BUILTIN_FUNCTION(12, _bi353, builtin_inline_class_353, 0),
    RB_BUILTIN_FUNCTION(13, _bi365, builtin_inline_class_365, 0),
    RB_BUILTIN_FUNCTION(14, _bi377, builtin_inline_class_377, 0),
    RB_BUILTIN_FUNCTION(15, _bi387, builtin_inline_class_387, 0),
    RB_BUILTIN_FUNCTION(-1, NULL, NULL, 0),
  };

  // arity_check
COMPILER_WARNING_PUSH
#if GCC_VERSION_SINCE(5, 1, 0) || defined __clang__
COMPILER_WARNING_ERROR(-Wincompatible-pointer-types)
#endif
  if (0) rb_builtin_function_check_arity4(gc_start_internal);
  if (0) rb_builtin_function_check_arity0(gc_enable);
  if (0) rb_builtin_function_check_arity0(gc_disable);
  if (0) rb_builtin_function_check_arity0(gc_stress_get);
  if (0) rb_builtin_function_check_arity1(gc_stress_set_m);
  if (0) rb_builtin_function_check_arity0(gc_count);
  if (0) rb_builtin_function_check_arity1(gc_stat);
  if (0) rb_builtin_function_check_arity2(gc_stat_heap);
  if (0) rb_builtin_function_check_arity0(gc_config_get);
  if (0) rb_builtin_function_check_arity0(builtin_inline_class_321);
  if (0) rb_builtin_function_check_arity1(gc_config_set);
  if (0) rb_builtin_function_check_arity0(builtin_inline_class_349);
  if (0) rb_builtin_function_check_arity0(builtin_inline_class_353);
  if (0) rb_builtin_function_check_arity0(builtin_inline_class_365);
  if (0) rb_builtin_function_check_arity0(builtin_inline_class_377);
  if (0) rb_builtin_function_check_arity0(builtin_inline_class_387);
COMPILER_WARNING_POP

  // load
  rb_load_with_builtin_functions("gc", gc_table);
}