176 |
scm_t_i_rstate * |
scm_t_i_rstate * |
177 |
scm_i_copy_rstate (scm_t_i_rstate *state) |
scm_i_copy_rstate (scm_t_i_rstate *state) |
178 |
{ |
{ |
179 |
scm_t_rstate *new_state = malloc (scm_the_rng.rstate_size); |
scm_t_rstate *new_state = scm_malloc (scm_the_rng.rstate_size); |
180 |
if (new_state == 0) |
if (new_state == 0) |
181 |
scm_memory_error ("rstate"); |
scm_memory_error ("rstate"); |
182 |
return memcpy (new_state, state, scm_the_rng.rstate_size); |
return memcpy (new_state, state, scm_the_rng.rstate_size); |
190 |
scm_t_rstate * |
scm_t_rstate * |
191 |
scm_c_make_rstate (char *seed, int n) |
scm_c_make_rstate (char *seed, int n) |
192 |
{ |
{ |
193 |
scm_t_rstate *state = malloc (scm_the_rng.rstate_size); |
scm_t_rstate *state = scm_malloc (scm_the_rng.rstate_size); |
194 |
if (state == 0) |
if (state == 0) |
195 |
scm_memory_error ("rstate"); |
scm_memory_error ("rstate"); |
196 |
state->reserved0 = 0; |
state->reserved0 = 0; |