#[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
Trait Implementations§
impl Copy for RRegexp
impl Eq for RRegexp
impl StructuralPartialEq for RRegexp
Auto Trait Implementations§
impl Freeze for RRegexp
impl RefUnwindSafe for RRegexp
impl !Send for RRegexp
impl !Sync for RRegexp
impl Unpin for RRegexp
impl UnwindSafe for RRegexp
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)