ruby/ext/ripper
KJ Tsanaktsidis f8effa209a Change the semantics of rb_postponed_job_register
Our current implementation of rb_postponed_job_register suffers from
some safety issues that can lead to interpreter crashes (see bug #1991).
Essentially, the issue is that jobs can be called with the wrong
arguments.

We made two attempts to fix this whilst keeping the promised semantics,
but:
  * The first one involved masking/unmasking when flushing jobs, which
    was believed to be too expensive
  * The second one involved a lock-free, multi-producer, single-consumer
    ringbuffer, which was too complex

The critical insight behind this third solution is that essentially the
only user of these APIs are a) internal, or b) profiling gems.

For a), none of the usages actually require variable data; they will
work just fine with the preregistration interface.

For b), generally profiling gems only call a single callback with a
single piece of data (which is actually usually just zero) for the life
of the program. The ringbuffer is complex because it needs to support
multi-word inserts of job & data (which can't be atomic); but nobody
actually even needs that functionality, really.

So, this comit:
  * Introduces a pre-registration API for jobs, with a GVL-requiring
    rb_postponed_job_prereigster, which returns a handle which can be
    used with an async-signal-safe rb_postponed_job_trigger.
  * Deprecates rb_postponed_job_register (and re-implements it on top of
    the preregister function for compatability)
  * Moves all the internal usages of postponed job register
    pre-registration
2023-12-10 15:00:37 +09:00
..
lib [Bug #19399] Parsing invalid heredoc inside block parameter 2023-02-02 12:20:10 +09:00
tools ripper: Support member references in the DSL 2023-10-10 00:09:52 +09:00
README Ripper does not depend on Bison [ci skip] 2023-06-03 10:34:24 +09:00
depend Change the semantics of rb_postponed_job_register 2023-12-10 15:00:37 +09:00
eventids2.c [Feature #19719] Universal Parser 2023-06-12 18:23:48 +09:00
eventids2.h [Feature #19719] Universal Parser 2023-06-12 18:23:48 +09:00
extconf.rb Stop creating ripper.h because it's not used 2023-10-20 12:56:04 +09:00
ripper_init.c.tmpl Extract `ripper_parser_params` 2023-09-30 20:17:38 +09:00
ripper_init.h [Feature #19719] Universal Parser 2023-06-12 18:23:48 +09:00

README

Ripper README
=============

  Ripper is a Ruby script parser.  You can get information
  by event-based style from the parser.

  !! WARNING !!

  Ripper is still early-alpha version.
  I never assure any kind of backward compatibility.

Requirements
------------

  * ruby 1.9 (support CVS HEAD only)

Usage
-----

  See test/ripper/* and sample/ripper/*.

License
-------

  Ruby License.

                                                Minero Aoki
                                        aamine@loveruby.net
                                      http://i.loveruby.net