Ruby  2.1.10p492(2016-04-01revision54464)
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
random.c File Reference
#include "ruby/ruby.h"
#include "internal.h"
#include <limits.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <math.h>
#include <errno.h>
#include "siphash.c"

Go to the source code of this file.

Data Structures

struct  MT
 
struct  rb_random_t
 

Macros

#define N   624
 
#define M   397
 
#define MATRIX_A   0x9908b0dfU /* constant vector a */
 
#define UMASK   0x80000000U /* most significant w-r bits */
 
#define LMASK   0x7fffffffU /* least significant r bits */
 
#define MIXBITS(u, v)   ( ((u) & UMASK) | ((v) & LMASK) )
 
#define TWIST(u, v)   ((MIXBITS((u),(v)) >> 1) ^ ((v)&1U ? MATRIX_A : 0U))
 
#define genrand_initialized(mt)   ((mt)->next != 0)
 
#define uninit_genrand(mt)   ((mt)->next = 0)
 
#define DEFAULT_SEED_CNT   4
 
#define SIZEOF_INT32   (31/CHAR_BIT + 1)
 
#define id_minus   '-'
 
#define id_plus   '+'
 
#define DEFAULT_SEED_LEN   (DEFAULT_SEED_CNT * (int)sizeof(int32_t))
 
#define USE_DEV_URANDOM   0
 
#define SIP_HASH_STREAMING   0
 
#define sip_hash24   ruby_sip_hash24
 
#define BYTE_ORDER   LITTLE_ENDIAN
 
#define LITTLE_ENDIAN   1234
 
#define BIG_ENDIAN   4321
 

Typedefs

typedef int int_must_be_32bit_at_least[sizeof(int) *CHAR_BIT< 32 ? -1 :1]
 

Enumerations

enum  { MT_MAX_STATE = N }
 

Functions

static void init_genrand (struct MT *mt, unsigned int s)
 
static void init_by_array (struct MT *mt, unsigned int init_key[], int key_length)
 
static void next_state (struct MT *mt)
 
static unsigned int genrand_int32 (struct MT *mt)
 
static double genrand_real (struct MT *mt)
 
static double int_pair_to_real_inclusive (uint32_t a, uint32_t b)
 
static double genrand_real2 (struct MT *mt)
 
static VALUE rand_init (struct MT *mt, VALUE vseed)
 
static VALUE random_seed (void)
 
static rb_random_trand_start (rb_random_t *r)
 
static struct MTdefault_mt (void)
 
unsigned int rb_genrand_int32 (void)
 
double rb_genrand_real (void)
 
static void random_mark (void *ptr)
 
static void random_free (void *ptr)
 
static size_t random_memsize (const void *ptr)
 
static rb_random_tget_rnd (VALUE obj)
 
static rb_random_ttry_get_rnd (VALUE obj)
 
static VALUE random_alloc (VALUE klass)
 
static VALUE random_init (int argc, VALUE *argv, VALUE obj)
 
static void fill_random_seed (uint32_t seed[DEFAULT_SEED_CNT])
 
static VALUE make_seed_value (const uint32_t *ptr)
 
static VALUE random_get_seed (VALUE obj)
 
static VALUE random_copy (VALUE obj, VALUE orig)
 
static VALUE mt_state (const struct MT *mt)
 
static VALUE random_state (VALUE obj)
 
static VALUE random_s_state (VALUE klass)
 
static VALUE random_left (VALUE obj)
 
static VALUE random_s_left (VALUE klass)
 
static VALUE random_dump (VALUE obj)
 
static VALUE random_load (VALUE obj, VALUE dump)
 
static VALUE rb_f_srand (int argc, VALUE *argv, VALUE obj)
 
static unsigned long make_mask (unsigned long x)
 
static unsigned long limited_rand (struct MT *mt, unsigned long limit)
 
static VALUE limited_big_rand (struct MT *mt, VALUE limit)
 
unsigned long rb_genrand_ulong_limited (unsigned long limit)
 
unsigned int rb_random_int32 (VALUE obj)
 
double rb_random_real (VALUE obj)
 
static VALUE ulong_to_num_plus_1 (unsigned long n)
 
unsigned long rb_random_ulong_limited (VALUE obj, unsigned long limit)
 
static VALUE random_bytes (VALUE obj, VALUE len)
 
VALUE rb_random_bytes (VALUE obj, long n)
 
static VALUE range_values (VALUE vmax, VALUE *begp, VALUE *endp, int *exclp)
 
static VALUE rand_int (struct MT *mt, VALUE vmax, int restrictive)
 
static double float_value (VALUE v)
 
static VALUE rand_range (struct MT *mt, VALUE range)
 
static VALUE rand_random (int argc, VALUE *argv, rb_random_t *rnd)
 
static VALUE random_rand (int argc, VALUE *argv, VALUE obj)
 
static VALUE random_equal (VALUE self, VALUE other)
 
static VALUE rb_f_rand (int argc, VALUE *argv, VALUE obj)
 
static VALUE random_s_rand (int argc, VALUE *argv, VALUE obj)
 
static VALUE init_randomseed (struct MT *mt, uint32_t initial[DEFAULT_SEED_CNT])
 
void Init_RandomSeed (void)
 
st_index_t rb_hash_start (st_index_t h)
 
st_index_t rb_memhash (const void *ptr, long len)
 
static void Init_RandomSeed2 (void)
 
void rb_reset_random_seed (void)
 
void Init_Random (void)
 

Variables

static rb_random_t default_rand
 
VALUE rb_cRandom
 
static ID id_rand
 
static ID id_bytes
 
static const rb_data_type_t random_data_type
 
static st_index_t hashseed
 
union {
   uint8_t   key [16]
 
   uint32_t   u32 [(16 *sizeof(uint8_t)
      - 1)/sizeof(uint32_t)]
 
sipseed
 

Macro Definition Documentation

◆ BIG_ENDIAN

#define BIG_ENDIAN   4321

Definition at line 1243 of file random.c.

◆ BYTE_ORDER

#define BYTE_ORDER   LITTLE_ENDIAN

Definition at line 1237 of file random.c.

Referenced by SHA256_Transform(), and SHA512_Transform().

◆ DEFAULT_SEED_CNT

#define DEFAULT_SEED_CNT   4

Definition at line 227 of file random.c.

Referenced by init_randomseed(), Init_RandomSeed(), make_seed_value(), and random_seed().

◆ DEFAULT_SEED_LEN

#define DEFAULT_SEED_LEN   (DEFAULT_SEED_CNT * (int)sizeof(int32_t))

Definition at line 429 of file random.c.

Referenced by fill_random_seed(), and init_randomseed().

◆ genrand_initialized

#define genrand_initialized (   mt)    ((mt)->next != 0)

Definition at line 110 of file random.c.

Referenced by rand_start().

◆ id_minus

#define id_minus   '-'

Definition at line 307 of file random.c.

Referenced by range_values().

◆ id_plus

#define id_plus   '+'

Definition at line 308 of file random.c.

Referenced by rand_range().

◆ LITTLE_ENDIAN

#define LITTLE_ENDIAN   1234

Definition at line 1240 of file random.c.

Referenced by SHA256_Transform(), and SHA512_Transform().

◆ LMASK

#define LMASK   0x7fffffffU /* least significant r bits */

Definition at line 97 of file random.c.

◆ M

#define M   397

Definition at line 94 of file random.c.

Referenced by next_state().

◆ MATRIX_A

#define MATRIX_A   0x9908b0dfU /* constant vector a */

Definition at line 95 of file random.c.

◆ MIXBITS

#define MIXBITS (   u,
 
)    ( ((u) & UMASK) | ((v) & LMASK) )

Definition at line 98 of file random.c.

◆ N

#define N   624

Definition at line 93 of file random.c.

Referenced by init_by_array(), init_genrand(), and next_state().

◆ sip_hash24

#define sip_hash24   ruby_sip_hash24

Definition at line 1232 of file random.c.

Referenced by rb_memhash().

◆ SIP_HASH_STREAMING

#define SIP_HASH_STREAMING   0

Definition at line 1231 of file random.c.

◆ SIZEOF_INT32

#define SIZEOF_INT32   (31/CHAR_BIT + 1)

Definition at line 264 of file random.c.

Referenced by limited_rand(), rand_init(), and rb_random_bytes().

◆ TWIST

#define TWIST (   u,
 
)    ((MIXBITS((u),(v)) >> 1) ^ ((v)&1U ? MATRIX_A : 0U))

Definition at line 99 of file random.c.

Referenced by next_state().

◆ UMASK

#define UMASK   0x80000000U /* most significant w-r bits */

Definition at line 96 of file random.c.

◆ uninit_genrand

#define uninit_genrand (   mt)    ((mt)->next = 0)

Definition at line 111 of file random.c.

Referenced by rb_reset_random_seed().

◆ USE_DEV_URANDOM

#define USE_DEV_URANDOM   0

Definition at line 434 of file random.c.

Typedef Documentation

◆ int_must_be_32bit_at_least

typedef int int_must_be_32bit_at_least[sizeof(int) *CHAR_BIT< 32 ? -1 :1]

Definition at line 90 of file random.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MT_MAX_STATE 

Definition at line 101 of file random.c.

Function Documentation

◆ default_mt()

static struct MT* default_mt ( void  )
static

◆ fill_random_seed()

static void fill_random_seed ( uint32_t  seed[DEFAULT_SEED_CNT])
static

◆ float_value()

static double float_value ( VALUE  v)
inlinestatic

Definition at line 959 of file random.c.

References INT2FIX, isinf(), isnan, rb_class_new_instance(), rb_eSystemCallError, rb_exc_raise(), and RFLOAT_VALUE.

Referenced by rand_random(), and rand_range().

◆ genrand_int32()

static unsigned int genrand_int32 ( struct MT mt)
static

◆ genrand_real()

static double genrand_real ( struct MT mt)
static

Definition at line 200 of file random.c.

References genrand_int32().

Referenced by rand_random(), rand_range(), rb_f_rand(), rb_genrand_real(), and rb_random_real().

◆ genrand_real2()

static double genrand_real2 ( struct MT mt)
static

Definition at line 210 of file random.c.

References genrand_int32(), and int_pair_to_real_inclusive().

Referenced by rand_range().

◆ get_rnd()

static rb_random_t* get_rnd ( VALUE  obj)
static

◆ init_by_array()

static void init_by_array ( struct MT mt,
unsigned int  init_key[],
int  key_length 
)
static

Definition at line 136 of file random.c.

References init_genrand(), N, and MT::state.

Referenced by init_randomseed(), and rand_init().

◆ init_genrand()

static void init_genrand ( struct MT mt,
unsigned int  s 
)
static

Definition at line 115 of file random.c.

References MT::left, N, MT::next, and MT::state.

Referenced by init_by_array(), and rand_init().

◆ Init_Random()

void Init_Random ( void  )

◆ init_randomseed()

static VALUE init_randomseed ( struct MT mt,
uint32_t  initial[DEFAULT_SEED_CNT] 
)
static

◆ Init_RandomSeed()

void Init_RandomSeed ( void  )

◆ Init_RandomSeed2()

static void Init_RandomSeed2 ( void  )
static

Definition at line 1313 of file random.c.

References default_rand, rb_cBignum, rb_obj_reveal(), RB_TYPE_P, rb_random_t::seed, and T_BIGNUM.

Referenced by Init_Random().

◆ int_pair_to_real_inclusive()

static double int_pair_to_real_inclusive ( uint32_t  a,
uint32_t  b 
)
static

◆ limited_big_rand()

static VALUE limited_big_rand ( struct MT mt,
VALUE  limit 
)
static

◆ limited_rand()

static unsigned long limited_rand ( struct MT mt,
unsigned long  limit 
)
static

◆ make_mask()

static unsigned long make_mask ( unsigned long  x)
static

Definition at line 698 of file random.c.

Referenced by limited_big_rand(), and limited_rand().

◆ make_seed_value()

static VALUE make_seed_value ( const uint32_t ptr)
static

◆ mt_state()

static VALUE mt_state ( const struct MT mt)
static

◆ next_state()

static void next_state ( struct MT mt)
static

Definition at line 162 of file random.c.

References MT::left, M, N, MT::next, MT::state, and TWIST.

Referenced by genrand_int32().

◆ rand_init()

static VALUE rand_init ( struct MT mt,
VALUE  vseed 
)
static

◆ rand_int()

static VALUE rand_int ( struct MT mt,
VALUE  vmax,
int  restrictive 
)
static

◆ rand_random()

static VALUE rand_random ( int  argc,
VALUE argv,
rb_random_t rnd 
)
static

◆ rand_range()

static VALUE rand_range ( struct MT mt,
VALUE  range 
)
inlinestatic

◆ rand_start()

static rb_random_t* rand_start ( rb_random_t r)
static

◆ random_alloc()

static VALUE random_alloc ( VALUE  klass)
static

Definition at line 361 of file random.c.

References INT2FIX, random_data_type, rb_random_t::seed, and TypedData_Make_Struct.

Referenced by Init_Random().

◆ random_bytes()

static VALUE random_bytes ( VALUE  obj,
VALUE  len 
)
static

Definition at line 871 of file random.c.

References NUM2LONG, rb_random_bytes(), and rb_to_int().

Referenced by Init_Random().

◆ random_copy()

static VALUE random_copy ( VALUE  obj,
VALUE  orig 
)
static

Definition at line 550 of file random.c.

References get_rnd(), MT::left, rb_random_t::mt, MT::next, numberof, OBJ_INIT_COPY, and MT::state.

Referenced by Init_Random().

◆ random_dump()

static VALUE random_dump ( VALUE  obj)
static

Definition at line 606 of file random.c.

References get_rnd(), INT2FIX, MT::left, rb_random_t::mt, mt_state(), rb_ary_new2, rb_ary_push(), and rb_random_t::seed.

Referenced by Init_Random().

◆ random_equal()

static VALUE random_equal ( VALUE  self,
VALUE  other 
)
static

◆ random_free()

static void random_free ( void *  ptr)
static

Definition at line 319 of file random.c.

References default_rand, and xfree().

◆ random_get_seed()

static VALUE random_get_seed ( VALUE  obj)
static

Definition at line 543 of file random.c.

References get_rnd(), and rb_random_t::seed.

Referenced by Init_Random().

◆ random_init()

static VALUE random_init ( int  argc,
VALUE argv,
VALUE  obj 
)
static

◆ random_left()

static VALUE random_left ( VALUE  obj)
static

Definition at line 591 of file random.c.

References get_rnd(), INT2FIX, MT::left, and rb_random_t::mt.

Referenced by Init_Random().

◆ random_load()

static VALUE random_load ( VALUE  obj,
VALUE  dump 
)
static

◆ random_mark()

static void random_mark ( void *  ptr)
static

Definition at line 313 of file random.c.

References rb_gc_mark().

◆ random_memsize()

static size_t random_memsize ( const void *  ptr)
static

Definition at line 326 of file random.c.

◆ random_rand()

static VALUE random_rand ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 1082 of file random.c.

References argc, argv, get_rnd(), and rand_random().

Referenced by Init_Random().

◆ random_s_left()

static VALUE random_s_left ( VALUE  klass)
static

Definition at line 599 of file random.c.

References default_rand, INT2FIX, MT::left, and rb_random_t::mt.

Referenced by Init_Random().

◆ random_s_rand()

static VALUE random_s_rand ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 1226 of file random.c.

References argc, argv, default_rand, rand_random(), and rand_start().

Referenced by Init_Random().

◆ random_s_state()

static VALUE random_s_state ( VALUE  klass)
static

Definition at line 584 of file random.c.

References default_rand, rb_random_t::mt, and mt_state().

Referenced by Init_Random().

◆ random_seed()

static VALUE random_seed ( void  )
static

Definition at line 521 of file random.c.

References buf, DEFAULT_SEED_CNT, fill_random_seed(), and make_seed_value().

Referenced by Init_Random(), rand_start(), random_init(), and rb_f_srand().

◆ random_state()

static VALUE random_state ( VALUE  obj)
static

Definition at line 576 of file random.c.

References get_rnd(), rb_random_t::mt, and mt_state().

Referenced by Init_Random().

◆ range_values()

static VALUE range_values ( VALUE  vmax,
VALUE begp,
VALUE endp,
int *  exclp 
)
static

Definition at line 909 of file random.c.

References id_minus, NIL_P, Qfalse, rb_funcall2, rb_range_values(), and rb_respond_to().

Referenced by rand_range().

◆ rb_f_rand()

static VALUE rb_f_rand ( int  argc,
VALUE argv,
VALUE  obj 
)
static

◆ rb_f_srand()

static VALUE rb_f_srand ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 680 of file random.c.

References argc, argv, default_rand, rb_random_t::mt, rand_init(), random_seed(), rb_scan_args(), and rb_random_t::seed.

Referenced by Init_Random().

◆ rb_genrand_int32()

unsigned int rb_genrand_int32 ( void  )

Definition at line 251 of file random.c.

References default_mt(), and genrand_int32().

◆ rb_genrand_real()

double rb_genrand_real ( void  )

Definition at line 258 of file random.c.

References default_mt(), and genrand_real().

◆ rb_genrand_ulong_limited()

unsigned long rb_genrand_ulong_limited ( unsigned long  limit)

Definition at line 789 of file random.c.

References default_mt(), and limited_rand().

Referenced by bary_sparse_p().

◆ rb_hash_start()

st_index_t rb_hash_start ( st_index_t  h)

◆ rb_memhash()

st_index_t rb_memhash ( const void *  ptr,
long  len 
)

◆ rb_random_bytes()

VALUE rb_random_bytes ( VALUE  obj,
long  n 
)

◆ rb_random_int32()

unsigned int rb_random_int32 ( VALUE  obj)

◆ rb_random_real()

double rb_random_real ( VALUE  obj)

◆ rb_random_ulong_limited()

unsigned long rb_random_ulong_limited ( VALUE  obj,
unsigned long  limit 
)

◆ rb_reset_random_seed()

void rb_reset_random_seed ( void  )

Definition at line 1323 of file random.c.

References default_rand, INT2FIX, rb_random_t::mt, rb_random_t::seed, and uninit_genrand.

Referenced by rb_thread_atfork().

◆ try_get_rnd()

static rb_random_t* try_get_rnd ( VALUE  obj)
static

◆ ulong_to_num_plus_1()

static VALUE ulong_to_num_plus_1 ( unsigned long  n)
inlinestatic

Definition at line 830 of file random.c.

References INT2FIX, rb_big_plus(), and ULONG2NUM.

Referenced by rb_random_ulong_limited().

Variable Documentation

◆ default_rand

rb_random_t default_rand
static

◆ hashseed

st_index_t hashseed
static

Definition at line 1248 of file random.c.

Referenced by Init_RandomSeed(), and rb_hash_start().

◆ id_bytes

ID id_bytes
static

Definition at line 309 of file random.c.

Referenced by Init_Random(), and rb_random_bytes().

◆ id_rand

ID id_rand
static

Definition at line 309 of file random.c.

Referenced by Init_Random(), rb_random_int32(), rb_random_real(), and rb_random_ulong_limited().

◆ key

uint8_t key[16]

Definition at line 1250 of file random.c.

Referenced by add_direct(), add_packed_direct(), add_refined_method_entry_i(), ary_hash_orset(), assoc_i(), cbsubst_get_subst_key(), cdhash_each(), cdhash_set_label_i(), check_deadlock_i(), check_exec_env_i(), check_exec_options_i(), check_exec_options_i_extract(), check_exec_redirect(), check_exec_redirect1(), check_redefined_method(), clear_trace_func_i(), clone_const(), clone_const_i(), clone_method_i(), compare_posix_sh(), constat_delete(), copy_ivar_i(), coverage_result_i(), crypt(), cto_i(), cv_i(), cv_list_i(), delete_if_i(), delpair(), des_setkey(), duppair(), each_attr_def(), each_key_i(), each_pair_i(), each_pair_i_fast(), env_assoc(), env_fetch(), env_has_key(), env_replace_i(), env_select(), env_shift(), env_update_i(), eql_i(), fc_i(), fdbm_clear(), fdbm_delete(), fdbm_delete_if(), fdbm_each_key(), fdbm_each_pair(), fdbm_each_value(), fdbm_empty_p(), fdbm_fetch(), fdbm_has_key(), fdbm_has_value(), fdbm_invert(), fdbm_key(), fdbm_keys(), fdbm_length(), fdbm_select(), fdbm_shift(), fdbm_store(), fdbm_to_a(), fdbm_to_hash(), fdbm_values(), fgdbm_clear(), fgdbm_empty_p(), fgdbm_has_key(), fgdbm_length(), fgdbm_store(), fgdbm_values(), fill_envp_buf_i(), find_entry(), find_packed_index(), find_packed_index_from(), flatten_i(), force_chain_object(), foreach_safe_i(), free_keys_i(), fsdbm_clear(), fsdbm_delete(), fsdbm_delete_if(), fsdbm_each_key(), fsdbm_each_pair(), fsdbm_each_value(), fsdbm_empty_p(), fsdbm_fetch(), fsdbm_has_key(), fsdbm_has_value(), fsdbm_invert(), fsdbm_key(), fsdbm_keys(), fsdbm_length(), fsdbm_select(), fsdbm_shift(), fsdbm_store(), fsdbm_to_a(), fsdbm_to_hash(), fsdbm_values(), fstr_update_callback(), fstring_set_class_i(), gc_info_decode(), gc_stat_internal(), generate_json_object(), generic_ivar_remove(), get_keys(), get_values(), getnext(), getnkey(), getpair(), gvar_i(), hash2named_arg(), hash2ptr_dispparams(), hash_aset(), hash_aset_str(), hash_default_value(), hash_each(), hash_foreach_iter(), hash_i(), i_free_name_entry(), i_free_shared_class(), inspect_i(), int_sip_init(), internal_match(), iseq_compile_each(), ivar_i(), keep_if_i(), key2keyname(), key_i(), keys_i(), kwcheck_i(), kwmerge_i(), lep_svar_get(), lep_svar_set(), list_i(), load_unlock(), loaded_features_index_clear_i(), mark_key(), mark_keyvalue(), method_entry_i(), move_refined_method(), new_entry(), obj_ivar_each(), obj_ivar_i(), object_allocations_reporter_i(), oletypelib_path(), onig_st_insert_strend(), onig_st_lookup_strend(), ossl_call_client_cert_cb(), ossl_cipher_init(), ossl_cipher_initialize(), ossl_cipher_pkcs5_keyivgen(), ossl_cipher_set_key(), ossl_hmac_initialize(), ossl_hmac_s_digest(), ossl_hmac_s_hexdigest(), ossl_pkcs12_initialize(), ossl_pkcs12_s_create(), ossl_pkcs7_decrypt(), ossl_pkcs7_s_sign(), ossl_pkcs7si_initialize(), ossl_spki_set_public_key(), ossl_spki_sign(), ossl_spki_verify(), ossl_sslctx_setup(), ossl_x509_check_private_key(), ossl_x509_set_public_key(), ossl_x509_sign(), ossl_x509_verify(), ossl_x509crl_sign(), ossl_x509crl_verify(), ossl_x509req_set_public_key(), ossl_x509req_sign(), ossl_x509req_verify(), parse_exp(), parse_keyword_arg_i(), PEM_def_callback(), push_kv(), push_kv_enc(), putpair(), r_fixup_compat(), r_object0(), rassoc_i(), rb_ary_assoc(), rb_enc_aliases_enc_i(), rb_exec_arg_addopt(), rb_execarg_addopt(), rb_execarg_fixup(), rb_execarg_run_options(), rb_free_generic_ivar(), rb_gc_latest_gc_info(), rb_gc_stat(), rb_gdbm_delete(), rb_gdbm_fetch(), rb_gdbm_fetch2(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), rb_get_kwargs(), rb_hash_aref(), rb_hash_aset(), rb_hash_assoc(), rb_hash_default(), rb_hash_delete(), rb_hash_delete_key(), rb_hash_fetch(), rb_hash_fetch_m(), rb_hash_has_key(), rb_hash_invert_i(), rb_hash_lookup(), rb_hash_lookup2(), rb_hash_rehash_i(), rb_hash_s_create(), rb_hash_update_block_callback(), rb_hash_update_block_i(), rb_hash_update_callback(), rb_hash_update_func_callback(), rb_hash_update_func_i(), rb_hash_update_i(), rb_iseq_parameters(), rb_reserved_word(), rb_st_insert_id_and_value(), rb_struct_each_pair(), rb_thread_aref(), rb_thread_key_p(), rb_thread_variable_get(), rb_thread_variable_p(), reachable_object_from_i(), reg_open_vkey(), register_init_ext(), reject_i(), release_thread_shield(), remove_method(), replace_i(), rgengc_unprotect_logging_exit_func_i(), run_exec_dup2(), run_final(), sdbm_delete(), sdbm_fetch(), sdbm_store(), seepair(), select_i(), separate_symbol(), set_state_ivars(), set_zero(), set_zero_i(), setkey(), shift_i_safe(), sip_hash24(), sip_hash_init(), sip_hash_new(), socklist_delete(), splpage(), st_add_direct(), st_delete(), st_delete_safe(), st_delete_wrap(), st_foreach(), st_foreach_check(), st_get_key(), st_insert(), st_insert2(), st_lookup(), st_shift(), st_update(), sv_i(), tbl_update(), terminate_atfork_before_exec_i(), terminate_atfork_i(), terminate_i(), thgroup_list_i(), thread_fd_close_i(), thread_keys_i(), thread_list_i(), to_a_i(), to_strkey(), tr_setup_table(), transcode_search_path_i(), type_cclass_hash(), unknown_keyword_error(), unpack_entries(), update_char_offset(), vm_cfp_svar_get(), vm_cfp_svar_set(), vm_getspecial(), vm_mark_each_thread_func(), vm_stat(), vm_svar_get(), vm_svar_set(), w_obj_each(), wmap_each_i(), wmap_each_key_i(), wmap_has_key(), wmap_inspect_i(), wmap_keys_i(), yaml_document_append_mapping_pair(), and zone_str_update().

◆ random_data_type

const rb_data_type_t random_data_type
static
Initial value:
= {
"random",
{
},
}
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1015
static void random_mark(void *ptr)
Definition: random.c:313
static void random_free(void *ptr)
Definition: random.c:319
static size_t random_memsize(const void *ptr)
Definition: random.c:326
#define NULL
Definition: _sdbm.c:102

Definition at line 331 of file random.c.

Referenced by get_rnd(), Init_Random(), random_alloc(), and try_get_rnd().

◆ rb_cRandom

VALUE rb_cRandom

Definition at line 306 of file random.c.

Referenced by Init_Random(), and try_get_rnd().

◆ sipseed

union { ... } sipseed

Referenced by Init_RandomSeed(), and rb_memhash().

◆ u32

Definition at line 1251 of file random.c.