Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Macros | Functions | Variables
gc.h File Reference

Go to the source code of this file.

## Macros
#define | SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p)
#define | USE_CONSERVATIVE_STACK_END
#define | RUBY_MARK_FREE_DEBUG 0
#define | RUBY_MARK_ENTER(msg)
#define | RUBY_MARK_LEAVE(msg)
#define | RUBY_FREE_ENTER(msg)
#define | RUBY_FREE_LEAVE(msg)
#define | RUBY_GC_INFO if(0)printf
#define | RUBY_MARK_NO_PIN_UNLESS_NULL(ptr)
#define | RUBY_MARK_UNLESS_NULL(ptr)
#define | RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;}
#define | stack_growup_p(x)
#define | STACK_UPPER(x, a, b) (stack_growup_p(x) ? (a) : (b))
#define | STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection
#define | STACK_DIR_UPPER(a, b) STACK_UPPER(&stack_grow_dir_detection, (a), (b))
#define | IS_STACK_DIR_UPPER() STACK_DIR_UPPER(1,0)

## Functions
| NOINLINE (void rb_gc_set_stack_end(VALUE **stack_end_p))
int | ruby_get_stack_grow_direction (volatile VALUE *addr)
const char * | rb_obj_info (VALUE obj)
const char * | rb_raw_obj_info (char *buff, const int buff_size, VALUE obj)
VALUE | rb_gc_disable_no_rest (void)
RUBY_SYMBOL_EXPORT_BEGIN size_t | rb_objspace_data_type_memsize (VALUE obj)
void | rb_objspace_reachable_objects_from (VALUE obj, void(func)(VALUE, void *), void *data)
void | rb_objspace_reachable_objects_from_root (void(func)(const char *category, VALUE, void *), void *data)
int | rb_objspace_markable_object_p (VALUE obj)
int | rb_objspace_internal_object_p (VALUE obj)
int | rb_objspace_marked_object_p (VALUE obj)
int | rb_objspace_garbage_object_p (VALUE obj)
void | rb_objspace_each_objects (int(*callback)(void *start, void *end, size_t stride, void *data), void *data)
void | rb_objspace_each_objects_without_setup (int(*callback)(void *, void *, size_t, void *), void *data)

## Variables
RUBY_EXTERN int | ruby_stack_grow_direction

## Macro Definition Documentation

## ◆ IS_STACK_DIR_UPPER

#define IS_STACK_DIR_UPPER | ( |  | ) | STACK_DIR_UPPER(1,0)

Definition at line 101 of file gc.h.

## ◆ RUBY_FREE_ENTER

#define RUBY_FREE_ENTER | ( |  | msg | ) |

Definition at line 57 of file gc.h.

## ◆ RUBY_FREE_LEAVE

#define RUBY_FREE_LEAVE | ( |  | msg | ) |

Definition at line 58 of file gc.h.

## ◆ RUBY_FREE_UNLESS_NULL

#define RUBY_FREE_UNLESS_NULL | ( |  | ptr | ) | if(ptr){ruby_xfree(ptr);(ptr)=NULL;}

Definition at line 70 of file gc.h.

## ◆ RUBY_GC_INFO

#define RUBY_GC_INFO if(0)printf

Definition at line 59 of file gc.h.

## ◆ RUBY_MARK_ENTER

#define RUBY_MARK_ENTER | ( |  | msg | ) |

Definition at line 55 of file gc.h.

## ◆ RUBY_MARK_FREE_DEBUG

#define RUBY_MARK_FREE_DEBUG 0

Definition at line 20 of file gc.h.

## ◆ RUBY_MARK_LEAVE

#define RUBY_MARK_LEAVE | ( |  | msg | ) |

Definition at line 56 of file gc.h.

## ◆ RUBY_MARK_NO_PIN_UNLESS_NULL

#define RUBY_MARK_NO_PIN_UNLESS_NULL | ( |  | ptr | ) |

Value:
do { \
VALUE markobj = (ptr); \
if (RTEST(markobj)) {rb_gc_mark_movable(markobj);} \
} while (0)

Definition at line 62 of file gc.h.

## ◆ RUBY_MARK_UNLESS_NULL

#define RUBY_MARK_UNLESS_NULL | ( |  | ptr | ) |

Value:
do { \
VALUE markobj = (ptr); \
if (RTEST(markobj)) {rb_gc_mark(markobj);} \
} while (0)

Definition at line 66 of file gc.h.

## ◆ SET_MACHINE_STACK_END

#define SET_MACHINE_STACK_END | ( |  | p | ) | rb_gc_set_stack_end(p)

Definition at line 13 of file gc.h.

## ◆ STACK_DIR_UPPER

#define STACK_DIR_UPPER | ( |  | a,
|  |  | b
| ) |  | STACK_UPPER(&stack_grow_dir_detection, (a), (b))

Definition at line 99 of file gc.h.

## ◆ STACK_GROW_DIR_DETECTION

#define STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection

Definition at line 98 of file gc.h.

## ◆ stack_growup_p

#define stack_growup_p | ( |  | x | ) |

Value:
( \
(ruby_stack_grow_direction ? \
ruby_stack_grow_direction : \
ruby_get_stack_grow_direction(x)) > 0)

Definition at line 79 of file gc.h.

## ◆ STACK_UPPER

#define STACK_UPPER | ( |  | x,
|  |  | a,
|  |  | b
| ) |  | (stack_growup_p(x) ? (a) : (b))

Definition at line 83 of file gc.h.

## ◆ USE_CONSERVATIVE_STACK_END

#define USE_CONSERVATIVE_STACK_END

Definition at line 14 of file gc.h.

## Function Documentation

## ◆ NOINLINE()

NOINLINE | ( | void | rb_gc_set_stack_endVALUE **stack_end_p | ) |

## ◆ rb_gc_disable_no_rest()

VALUE rb_gc_disable_no_rest | ( | void |  | ) |

Definition at line 9225 of file gc.c.

## ◆ rb_obj_info()

const char* rb_obj_info | ( | VALUE | obj | ) |

Definition at line 11655 of file gc.c.

## ◆ rb_objspace_data_type_memsize()

RUBY_SYMBOL_EXPORT_BEGIN size_t rb_objspace_data_type_memsize | ( | VALUE | obj | ) |

Definition at line 2417 of file gc.c.

## ◆ rb_objspace_each_objects()

void rb_objspace_each_objects | ( | int(*)(void *start, void *end, size_t stride, void *data) | callback,
|  | void * | data
| ) |  |

## ◆ rb_objspace_each_objects_without_setup()

void rb_objspace_each_objects_without_setup | ( | int(*)(void *, void *, size_t, void *) | callback,
|  | void * | data
| ) |  |

## ◆ rb_objspace_garbage_object_p()

int rb_objspace_garbage_object_p | ( | VALUE | obj | ) |

Definition at line 3605 of file gc.c.

## ◆ rb_objspace_internal_object_p()

int rb_objspace_internal_object_p | ( | VALUE | obj | ) |

Definition at line 3095 of file gc.c.

## ◆ rb_objspace_markable_object_p()

int rb_objspace_markable_object_p | ( | VALUE | obj | ) |

Definition at line 3598 of file gc.c.

## ◆ rb_objspace_marked_object_p()

int rb_objspace_marked_object_p | ( | VALUE | obj | ) |

Definition at line 5222 of file gc.c.

## ◆ rb_objspace_reachable_objects_from()

void rb_objspace_reachable_objects_from | ( | VALUE | obj,
|  | void(func)(VALUE, void *) | ,
|  | void * | data
| ) |  |

Definition at line 9448 of file gc.c.

## ◆ rb_objspace_reachable_objects_from_root()

void rb_objspace_reachable_objects_from_root | ( | void(func)(const char *category, VALUE, void *) | ,
|  | void * | data
| ) |  |

Definition at line 9476 of file gc.c.

## ◆ rb_raw_obj_info()

const char* rb_raw_obj_info | ( | char * | buff,
|  | const int | buff_size,
|  | VALUE | obj
| ) |  |

Definition at line 11419 of file gc.c.

## ◆ ruby_get_stack_grow_direction()

int ruby_get_stack_grow_direction | ( | volatile VALUE * | addr | ) |

Definition at line 4620 of file gc.c.

References ruby_stack_grow_direction, and SET_MACHINE_STACK_END.

## Variable Documentation

## ◆ ruby_stack_grow_direction

RUBY_EXTERN int ruby_stack_grow_direction

Definition at line 77 of file gc.h.

ruby_stack_grow_direction
RUBY_EXTERN int ruby_stack_grow_direction
Definition: gc.h:77
ptr
struct RIMemo * ptr
Definition: debug.c:74
rb_gc_mark_movable
void rb_gc_mark_movable(VALUE ptr)
Definition: gc.c:5206
rb_gc_mark
void rb_gc_mark(VALUE ptr)
Definition: gc.c:5212
RTEST
#define RTEST(v)
Definition: ruby.h:481