ruby/internal/inits.h
John Hawthorn 73055acd57 Forbid setting ivars on Ractor shareable objects
Previously we had a check that objects which were shareable, but not
frozen on a non-main Ractor would raise an exception if instance
variables were read. This prevented a non-main Ractor reading
non-shareable objects.

This changes the behaviour to forbid all writes to shareable objects
(even when unfrozen). This is done by re-purposing the frozen flag on
the object shape to reflect (FL_FROZEN || FL_SHAREABLE).

With IV writes forbidden on all shareable objects whether or not they
are frozen (with the exception of classes and modules), we can also
remove the check against reading instance variables, since no unsafe
instance variables can be set.

[Bug #22291]
2026-09-16 12:26:11 -07:00

55 lines
1.2 KiB
C

#ifndef INTERNAL_INITS_H /*-*-C-*-vi:se ft=c:*/
#define INTERNAL_INITS_H
/**
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redistribute and/or
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
* @brief Internal header aggregating init functions.
*/
/* box.c */
void Init_enable_box(void);
void Init_master_box(void);
/* class.c */
void Init_class_hierarchy(void);
/* dmyext.c */
void Init_enc(void);
void Init_ext(void);
/* file.c */
void Init_File(void);
/* localeinit.c */
int Init_enc_set_filesystem_encoding(void);
/* newline.c */
void Init_newline(void);
/* shape.c */
void Init_default_shapes(void);
/* vm.c */
void Init_BareVM(void);
void Init_vm_objects(void);
/* vm_backtrace.c */
void Init_vm_backtrace(void);
/* vm_eval.c */
void Init_vm_eval(void);
/* vm_insnhelper.c */
void Init_vm_stack_canary(void);
/* vm_method.c */
void Init_eval_method(void);
/* inits.c */
void rb_call_inits(void);
#endif /* INTERNAL_INITS_H */