Module: Corkscrews::Delay
- Defined in:
- ext/corkscrews/delay.c
Class Method Summary collapse
- .available? ⇒ Boolean
- .clear_experiment ⇒ Object
- .debt_current ⇒ Object
- .request_settle ⇒ Object
- .set_experiment(kind, iseq, line, speedup) ⇒ Object
- .set_sample_period(period_ns) ⇒ Object
- .settle_current ⇒ Object
- .settled_now ⇒ Object
- .stamp_inherit(object) ⇒ Object
- .stamp_write(object) ⇒ Object
Class Method Details
.available? ⇒ Boolean
154 155 156 157 158 159 |
# File 'ext/corkscrews/delay.c', line 154
static VALUE
delay_available_p(VALUE self)
{
(void)self;
return Qtrue;
}
|
.clear_experiment ⇒ Object
177 178 179 180 181 182 183 |
# File 'ext/corkscrews/delay.c', line 177
static VALUE
delay_clear_experiment(VALUE self)
{
(void)self;
cs_delay_clear_experiment();
return Qnil;
}
|
.debt_current ⇒ Object
200 201 202 203 204 205 206 207 |
# File 'ext/corkscrews/delay.c', line 200
static VALUE
delay_debt_current(VALUE self)
{
(void)self;
uint64_t global = atomic_load(&cs_global.global_delay_ns);
uint64_t settled = cs_settled_now_for_current_thread();
return ULL2NUM(global > settled ? global - settled : 0);
}
|
.request_settle ⇒ Object
192 193 194 195 196 197 198 |
# File 'ext/corkscrews/delay.c', line 192
static VALUE
delay_request_settle(VALUE self)
{
(void)self;
cs_delay_request_settle();
return Qnil;
}
|
.set_experiment(kind, iseq, line, speedup) ⇒ Object
161 162 163 164 165 166 167 |
# File 'ext/corkscrews/delay.c', line 161
static VALUE
delay_set_experiment(VALUE self, VALUE kind, VALUE iseq, VALUE line, VALUE speedup)
{
(void)self;
cs_delay_set_experiment(NUM2UINT(kind), (uintptr_t)NUM2ULL(iseq), NUM2UINT(line), NUM2UINT(speedup));
return Qnil;
}
|
.set_sample_period(period_ns) ⇒ Object
169 170 171 172 173 174 175 |
# File 'ext/corkscrews/delay.c', line 169
static VALUE
delay_set_sample_period(VALUE self, VALUE period_ns)
{
(void)self;
atomic_store(&cs_global.sample_period_ns, NUM2ULL(period_ns));
return Qnil;
}
|
.settle_current ⇒ Object
185 186 187 188 189 190 |
# File 'ext/corkscrews/delay.c', line 185
static VALUE
delay_settle_current(VALUE self)
{
(void)self;
return ULL2NUM(cs_delay_settle_current());
}
|
.settled_now ⇒ Object
209 210 211 212 213 214 |
# File 'ext/corkscrews/delay.c', line 209
static VALUE
delay_settled_now(VALUE self)
{
(void)self;
return ULL2NUM(cs_settled_now_for_current_thread());
}
|
.stamp_inherit(object) ⇒ Object
224 225 226 227 228 229 230 |
# File 'ext/corkscrews/delay.c', line 224
static VALUE
delay_stamp_inherit(VALUE self, VALUE object)
{
(void)self;
cs_stamp_inherit(object);
return Qnil;
}
|
.stamp_write(object) ⇒ Object
216 217 218 219 220 221 222 |
# File 'ext/corkscrews/delay.c', line 216
static VALUE
delay_stamp_write(VALUE self, VALUE object)
{
(void)self;
cs_stamp_write(object);
return Qnil;
}
|