aboutsummaryrefslogtreecommitdiffstats
path: root/hrtime.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix per-instance Regexp timeout (#6621)Yusuke Endoh2022-10-241-0/+1
| | | | | | | | | | Fix per-instance Regexp timeout This makes it follow what was decided in [Bug #19055]: * `Regexp.new(str, timeout: nil)` should respect the global timeout * `Regexp.new(str, timeout: huge_val)` should use the maximum value that can be represented in the internal representation * `Regexp.new(str, timeout: 0 or negative value)` should raise an error
* Implement Queue#pop(timeout: sec)Jean Boussier2022-08-021-0/+10
| | | | | | | | | [Feature #18774] As well as `SizedQueue#pop(timeout: sec)` If both `non_block=true` and `timeout:` are supplied, ArgumentError is raised.
* thread.c: Move double2hrtime and hrtime2double to hrtime.hYusuke Endoh2022-03-301-0/+48
| | | | ... to make them available in other places than thread.c
* hrtime.h: fix typo in non-builtin overflow checknormal2018-08-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hrtime.h: add note explaining current use of uint64_t [ci skip]normal2018-08-271-1/+2
| | | | | | [ruby-core:88678] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hrtime.h: missing parennobu2018-08-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hrtime.h: explicit casts to time_tnobu2018-08-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hrtime.h: add documentationnormal2018-08-251-1/+48
| | | | | | | | | I updated the patch with documentation but forgot about it, earlier :x [ruby-core:88616] [Misc #15014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: use rb_hrtime_t scalar for high-resolution time operationsnormal2018-08-251-0/+120
Relying on "struct timespec" was too annoying API-wise and used more stack space. "double" was a bit wacky w.r.t rounding in the past, so now we'll switch to using a 64-bit type. Unsigned 64-bit integer is able to give us over nearly 585 years of range with nanoseconds. This range is good enough for the Linux kernel internal time representation, so it ought to be good enough for us. This reduces the stack usage of functions while GVL is held (and thus subject to marking) on x86-64 Linux (with ppoll): rb_wait_for_single_fd 120 => 104 do_select 120 => 88 [ruby-core:88582] [Misc #15014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e