Ruby 3.5.0dev (2025-02-20 revision 34098b669c0cbc024cd08e686891f1dfe0a10aaf)
event.h
Go to the documentation of this file.
1#ifndef RBIMPL_EVENT_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_EVENT_H
24#include "ruby/internal/value.h"
25
26#ifdef HAVE_STDINT_H
27#include <stdint.h>
28#endif
29
30/* These macros are not enums because they are wider than int.*/
31
37#define RUBY_EVENT_NONE 0x0000
38#define RUBY_EVENT_LINE 0x0001
39#define RUBY_EVENT_CLASS 0x0002
40#define RUBY_EVENT_END 0x0004
41#define RUBY_EVENT_CALL 0x0008
42#define RUBY_EVENT_RETURN 0x0010
43#define RUBY_EVENT_C_CALL 0x0020
44#define RUBY_EVENT_C_RETURN 0x0040
45#define RUBY_EVENT_RAISE 0x0080
46#define RUBY_EVENT_ALL 0x00ff
55#define RUBY_EVENT_B_CALL 0x0100
56#define RUBY_EVENT_B_RETURN 0x0200
57#define RUBY_EVENT_THREAD_BEGIN 0x0400
58#define RUBY_EVENT_THREAD_END 0x0800
59#define RUBY_EVENT_FIBER_SWITCH 0x1000
60#define RUBY_EVENT_SCRIPT_COMPILED 0x2000
61#define RUBY_EVENT_RESCUE 0x4000
62#define RUBY_EVENT_TRACEPOINT_ALL 0xffff
77#define RUBY_EVENT_RESERVED_FOR_INTERNAL_USE 0x030000
90#define RUBY_INTERNAL_EVENT_SWITCH 0x040000
91#define RUBY_EVENT_SWITCH 0x040000
92 /* 0x080000 */
93#define RUBY_INTERNAL_EVENT_NEWOBJ 0x100000
94#define RUBY_INTERNAL_EVENT_FREEOBJ 0x200000
95#define RUBY_INTERNAL_EVENT_GC_START 0x400000
96#define RUBY_INTERNAL_EVENT_GC_END_MARK 0x800000
97#define RUBY_INTERNAL_EVENT_GC_END_SWEEP 0x1000000
98#define RUBY_INTERNAL_EVENT_GC_ENTER 0x2000000
99#define RUBY_INTERNAL_EVENT_GC_EXIT 0x4000000
100#define RUBY_INTERNAL_EVENT_OBJSPACE_MASK 0x7f00000
101#define RUBY_INTERNAL_EVENT_MASK 0xffff0000
108typedef uint32_t rb_event_flag_t;
109
120typedef void (*rb_event_hook_func_t)(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass);
121
129#define RB_EVENT_HOOKS_HAVE_CALLBACK_DATA 1
130
132
133
141
158
159#endif /* RBIMPL_EVENT_H */
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
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:205
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:313
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:120
uint32_t rb_event_flag_t
Represents event(s).
Definition event.h:108
Defines VALUE and ID.
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40