Skip to content

Commit

Permalink
Remove "ruby/ractor.h"
Browse files Browse the repository at this point in the history
  • Loading branch information
yui-knk committed Apr 14, 2023
1 parent 3635ebb commit 496b637
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions external/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ typedef struct rb_parser_config_struct {
/* IO */
int (*stderr_tty_p)(void);
void (*write_error_str)(VALUE mesg);
/* IO (Ractor) */
VALUE (*debug_output_stdout)(void);
VALUE (*debug_output_stderr)(void);

/* Ractor */
VALUE (*ractor_make_shareable)(VALUE obj);

/* Error */
const char *(*builtin_class_name)(VALUE x);
Expand Down
6 changes: 5 additions & 1 deletion parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ struct lex_context;
#include "ruby/ruby.h"
#include "ruby/st.h"
#include "ruby/util.h"
#include "ruby/ractor.h"
#include "symbol.h"

#ifdef RIPPER
Expand All @@ -63,6 +62,7 @@ struct lex_context;
#include "internal/re.h"
#include "internal/thread.h"
#include "ruby/regex.h"
#include "ruby/ractor.h"
#include "regenc.h"

#endif
Expand Down Expand Up @@ -150,6 +150,10 @@ RBIMPL_WARNING_POP()

#define rb_stderr_tty_p p->config.stderr_tty_p
#define rb_write_error_str p->config.write_error_str
#define rb_ractor_stdout p->config.debug_output_stdout
#define rb_ractor_stderr p->config.debug_output_stderr

#define rb_ractor_make_shareable p->config.ractor_make_shareable

#define rb_builtin_class_name p->config.builtin_class_name
#define rb_syntax_error_append p->config.syntax_error_append
Expand Down
5 changes: 5 additions & 0 deletions ruby_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "ruby/ruby.h"
#include "node.h"
#include "internal.h"
#include "ruby/ractor.h"

struct ruby_parser {
rb_parser_t *parser_params;
Expand Down Expand Up @@ -164,6 +165,10 @@ rb_parser_config_initialize(rb_parser_config_t *config)

config->stderr_tty_p = rb_stderr_tty_p;
config->write_error_str = rb_write_error_str;
config->debug_output_stdout = rb_ractor_stdout;
config->debug_output_stderr = rb_ractor_stderr;

config->ractor_make_shareable = rb_ractor_make_shareable;

config->builtin_class_name = rb_builtin_class_name;
config->syntax_error_append = syntax_error_append;
Expand Down

0 comments on commit 496b637

Please sign in to comment.