Ruby: include/ruby/internal/event.h Source File

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

event.h
Go to the documentation of this file.
1#ifndef RBIMPL_EVENT_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_EVENT_H
23#include "ruby/internal/dllexport.h"
24#include "ruby/internal/value.h"
25
26/* These macros are not enums because they are wider than int.*/
27
33#define RUBY_EVENT_NONE 0x0000
34#define RUBY_EVENT_LINE 0x0001
35#define RUBY_EVENT_CLASS 0x0002
36#define RUBY_EVENT_END 0x0004
37#define RUBY_EVENT_CALL 0x0008
38#define RUBY_EVENT_RETURN 0x0010
39#define RUBY_EVENT_C_CALL 0x0020
40#define RUBY_EVENT_C_RETURN 0x0040
41#define RUBY_EVENT_RAISE 0x0080
42#define RUBY_EVENT_ALL 0x00ff
51#define RUBY_EVENT_B_CALL 0x0100
52#define RUBY_EVENT_B_RETURN 0x0200
53#define RUBY_EVENT_THREAD_BEGIN 0x0400
54#define RUBY_EVENT_THREAD_END 0x0800
55#define RUBY_EVENT_FIBER_SWITCH 0x1000
56#define RUBY_EVENT_SCRIPT_COMPILED 0x2000
57#define RUBY_EVENT_TRACEPOINT_ALL 0xffff
72#define RUBY_EVENT_RESERVED_FOR_INTERNAL_USE 0x030000
85#define RUBY_INTERNAL_EVENT_SWITCH 0x040000
86#define RUBY_EVENT_SWITCH 0x040000
87 /* 0x080000 */
88#define RUBY_INTERNAL_EVENT_NEWOBJ 0x100000
89#define RUBY_INTERNAL_EVENT_FREEOBJ 0x200000
90#define RUBY_INTERNAL_EVENT_GC_START 0x400000
91#define RUBY_INTERNAL_EVENT_GC_END_MARK 0x800000
92#define RUBY_INTERNAL_EVENT_GC_END_SWEEP 0x1000000
93#define RUBY_INTERNAL_EVENT_GC_ENTER 0x2000000
94#define RUBY_INTERNAL_EVENT_GC_EXIT 0x4000000
95#define RUBY_INTERNAL_EVENT_OBJSPACE_MASK 0x7f00000
96#define RUBY_INTERNAL_EVENT_MASK 0xffff0000
103 typedef uint32_t rb_event_flag_t;
104
115 typedef void (*rb_event_hook_func_t)(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass);
116
124#define RB_EVENT_HOOKS_HAVE_CALLBACK_DATA 1
125
126 RBIMPL_SYMBOL_EXPORT_BEGIN()
127
128
135void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
136
151int rb_remove_event_hook(rb_event_hook_func_t func);
152 RBIMPL_SYMBOL_EXPORT_END()
153
154#endif /* RBIMPL_EVENT_H */
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:106
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:97
rb_add_event_hook
void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data)
Registers an event hook function.
Definition vm_trace.c:185
rb_remove_event_hook
int rb_remove_event_hook(rb_event_hook_func_t func)
Removes the passed function from the list of event hooks.
Definition vm_trace.c:293
rb_event_hook_func_t
void(* rb_event_hook_func_t)(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass)
Type of event hooks.
Definition event.h:115
rb_event_flag_t
uint32_t rb_event_flag_t
Represents event(s).
Definition event.h:103
value.h
Defines VALUE and ID.
ID
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40