Ruby: include/ruby/ractor.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Typedefs | Functions | Variables
ractor.h File Reference

Go to the source code of this file.

## Data Structures
struct | rb_ractor_local_storage_type

## Macros
#define | RB_RACTOR_LOCAL_STORAGE_TYPE_FREE (&rb_ractor_local_storage_type_free)
#define | RB_OBJ_SHAREABLE_P(obj) FL_TEST_RAW((obj), RUBY_FL_SHAREABLE)

## Typedefs
typedef struct rb_ractor_local_key_struct * | rb_ractor_local_key_t

## Functions
VALUE | rb_ractor_stdin (void)
VALUE | rb_ractor_stdout (void)
VALUE | rb_ractor_stderr (void)
void | rb_ractor_stdin_set (VALUE)
void | rb_ractor_stdout_set (VALUE)
void | rb_ractor_stderr_set (VALUE)
rb_ractor_local_key_t | rb_ractor_local_storage_value_newkey (void)
VALUE | rb_ractor_local_storage_value (rb_ractor_local_key_t key)
bool | rb_ractor_local_storage_value_lookup (rb_ractor_local_key_t key, VALUE *val)
void | rb_ractor_local_storage_value_set (rb_ractor_local_key_t key, VALUE val)
rb_ractor_local_key_t | rb_ractor_local_storage_ptr_newkey (const struct rb_ractor_local_storage_type *type)
void * | rb_ractor_local_storage_ptr (rb_ractor_local_key_t key)
void | rb_ractor_local_storage_ptr_set (rb_ractor_local_key_t key, void *ptr)
VALUE | rb_ractor_make_shareable (VALUE obj)
VALUE | rb_ractor_make_shareable_copy (VALUE obj)

## Variables
VALUE | rb_cRactor
const struct rb_ractor_local_storage_type | rb_ractor_local_storage_type_free

## Detailed Description

Author
  Koichi Sasada

Date
  Tue Nov 17 16:39:15 2020

Copyright
  Copyright (C) 2020 Yukihiro Matsumoto
  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.

Definition in file ractor.h.

## Macro Definition Documentation

## ◆ RB_OBJ_SHAREABLE_P

#define RB_OBJ_SHAREABLE_P | ( |  | obj | ) | FL_TEST_RAW((obj), RUBY_FL_SHAREABLE)

Definition at line 50 of file ractor.h.

## ◆ RB_RACTOR_LOCAL_STORAGE_TYPE_FREE

#define RB_RACTOR_LOCAL_STORAGE_TYPE_FREE (&rb_ractor_local_storage_type_free)

Definition at line 39 of file ractor.h.

## Typedef Documentation

## ◆ rb_ractor_local_key_t

typedef struct rb_ractor_local_key_struct* rb_ractor_local_key_t

Definition at line 21 of file ractor.h.

## Function Documentation

## ◆ rb_ractor_local_storage_ptr()

void * rb_ractor_local_storage_ptr | ( | rb_ractor_local_key_t | key | ) |

Definition at line 3195 of file ractor.c.

References key, and NULL.

## ◆ rb_ractor_local_storage_ptr_newkey()

rb_ractor_local_key_t rb_ractor_local_storage_ptr_newkey | ( | const struct rb_ractor_local_storage_type * | type | ) |

Definition at line 3097 of file ractor.c.

References ALLOC, key, and Qundef.

Referenced by Init_ossl_bn(), InitVM_Random(), and rb_ractor_local_storage_value_newkey().

## ◆ rb_ractor_local_storage_ptr_set()

void rb_ractor_local_storage_ptr_set | ( | rb_ractor_local_key_t | key,
|  | void * | ptr
| ) |  |

Definition at line 3207 of file ractor.c.

References key, and ptr.

## ◆ rb_ractor_local_storage_value()

VALUE rb_ractor_local_storage_value | ( | rb_ractor_local_key_t | key | ) |

Definition at line 3166 of file ractor.c.

References key, and Qnil.

## ◆ rb_ractor_local_storage_value_lookup()

bool rb_ractor_local_storage_value_lookup | ( | rb_ractor_local_key_t | key,
|  | VALUE * | val
| ) |  |

Definition at line 3178 of file ractor.c.

References key.

## ◆ rb_ractor_local_storage_value_newkey()

rb_ractor_local_key_t rb_ractor_local_storage_value_newkey | ( | void |  | ) |

Definition at line 3106 of file ractor.c.

References rb_ractor_local_storage_ptr_newkey().

## ◆ rb_ractor_local_storage_value_set()

void rb_ractor_local_storage_value_set | ( | rb_ractor_local_key_t | key,
|  | VALUE | val
| ) |  |

Definition at line 3189 of file ractor.c.

References key.

## ◆ rb_ractor_make_shareable()

VALUE rb_ractor_make_shareable | ( | VALUE | obj | ) |

Definition at line 2499 of file ractor.c.

## ◆ rb_ractor_make_shareable_copy()

VALUE rb_ractor_make_shareable_copy | ( | VALUE | obj | ) |

Definition at line 2508 of file ractor.c.

## ◆ rb_ractor_stderr()

VALUE rb_ractor_stderr | ( | void |  | ) |

Definition at line 2148 of file ractor.c.

References rb_ractor_struct::r_stderr, and rb_stderr.

Referenced by rb_f_abort(), rb_parser_fatal(), rb_write_error2(), and rb_write_error_str().

## ◆ rb_ractor_stderr_set()

void rb_ractor_stderr_set | ( | VALUE | err | ) |

Definition at line 2184 of file ractor.c.

References err, rb_ractor_struct::pub, rb_ractor_struct::r_stderr, RB_OBJ_WRITE, rb_stderr, and rb_ractor_pub::self.

## ◆ rb_ractor_stdin()

VALUE rb_ractor_stdin | ( | void |  | ) |

Definition at line 2124 of file ractor.c.

References rb_ractor_struct::r_stdin, and rb_stdin.

## ◆ rb_ractor_stdin_set()

void rb_ractor_stdin_set | ( | VALUE | in | ) |

Definition at line 2160 of file ractor.c.

References in(), rb_ractor_struct::pub, rb_ractor_struct::r_stdin, RB_OBJ_WRITE, rb_stdin, and rb_ractor_pub::self.

## ◆ rb_ractor_stdout()

VALUE rb_ractor_stdout | ( | void |  | ) |

Definition at line 2136 of file ractor.c.

References rb_ractor_struct::r_stdout, and rb_stdout.

Referenced by rb_io_getbyte(), and rb_parser_fatal().

## ◆ rb_ractor_stdout_set()

void rb_ractor_stdout_set | ( | VALUE | out | ) |

Definition at line 2172 of file ractor.c.

References out, rb_ractor_struct::pub, rb_ractor_struct::r_stdout, RB_OBJ_WRITE, rb_stdout, and rb_ractor_pub::self.

## Variable Documentation

## ◆ rb_cRactor

VALUE rb_cRactor
| extern

Definition at line 20 of file ractor.c.

Referenced by Init_Ractor(), and rb_ractor_main_setup().

## ◆ rb_ractor_local_storage_type_free

const struct rb_ractor_local_storage_type rb_ractor_local_storage_type_free
| extern

Definition at line 3086 of file ractor.c.