Skip to content

Commit

Permalink
[DOC] Fix markup in declarative marking API document
Browse files Browse the repository at this point in the history
- RDoc is not markdown, use `+` and `_` for code and variables
  respectively, instead of backquotes.

- Remove useless backslashes.
  • Loading branch information
nobu committed Nov 26, 2023
1 parent 9cd086b commit 688faa9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doc/extension.rdoc
Expand Up @@ -779,26 +779,26 @@ approach to marking and reference updating is provided, by declaring offset
references to the VALUES in your struct.

Doing this allows the Ruby GC to support marking these references and GC
compaction without the need to define the `dmark` and `dcompact` callbacks.
compaction without the need to define the +dmark+ and +dcompact+ callbacks.

You must define a static list of VALUE pointers to the offsets within your
struct where the references are located, and set the "data" member to point to
this reference list. The reference list must end with `END_REFS`
this reference list. The reference list must end with +RUBY_END_REFS+.

Some Macros have been provided to make edge referencing easier:

* <code>RUBY_TYPED_DECL_MARKING</code> =A flag that can be set on the `ruby_data_type_t` to indicate that references are being declared as edges.
* <code>RUBY_TYPED_DECL_MARKING</code> =A flag that can be set on the +ruby_data_type_t+ to indicate that references are being declared as edges.

* <code>RUBY_REFERENCES_START(ref_list_name)</code> - Define `ref_list_name` as a list of references
* <code>RUBY_REFERENCES_START(ref_list_name)</code> - Define _ref_list_name_ as a list of references

* <code>RUBY_REFERENCES_END</code> - Mark the end of the references list. This will take care of terminating the list correctly

* <code>RUBY_REF_EDGE\(struct, member\)</code> - Declare `member` as a VALUE edge from `struct`. Use this after `RUBY_REFERENCES_START`
* <code>RUBY_REF_EDGE(struct, member)</code> - Declare _member_ as a VALUE edge from _struct_. Use this after +RUBY_REFERENCES_START+

* +REFS_LIST_PTR+ - Coerce the reference list into a format that can be
accepted by the existing `dmark` interface.
accepted by the existing +dmark+ interface.

The example below is from `Dir` (defined in `dir.c`)
The example below is from Dir (defined in +dir.c+)

// The struct being wrapped. Notice this contains 3 members of which the second
// is a VALUE reference to another ruby object.
Expand Down

0 comments on commit 688faa9

Please sign in to comment.