#[repr(C)]pub struct RRegexp {
pub basic: RBasic,
pub ptr: *mut re_pattern_buffer,
pub src: VALUE,
pub usecnt: c_ulong,
}Expand description
Fields§
§basic: RBasic§ptr: *mut re_pattern_bufferThe pattern buffer. This is a quasi-opaque struct that holds compiled intermediate representation of the regular expression.
§@note Compilation of a regexp could be delayed until actual match.
Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3
src: VALUE§usecnt: c_ulongReference count. A regexp match can take extraordinarily long time to run. Ruby’s regular expression is heavily extended and not a regular language any longer; runs in NP-time in practice. Now, Ruby also has threads and GVL. In order to prevent long GVL lockup, our regexp engine can release it on occasions. This means that multiple threads can touch a regular expressions at once. That itself is okay. But their cleanup phase shall wait for all the concurrent runs, to prevent use-after-free situation. This field is used to count such threads that are executing this particular pattern buffer.
§@warning Of course, touching this field from extension libraries causes catastrophic effects. Just leave it.
Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3