diff options
Diffstat (limited to 'ext/coverage/coverage.c')
| -rw-r--r-- | ext/coverage/coverage.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c index 399e28cdab..1fda8191cc 100644 --- a/ext/coverage/coverage.c +++ b/ext/coverage/coverage.c @@ -8,7 +8,7 @@ ************************************************/ -#include "gc.h" +#include "internal/gc.h" #include "internal/hash.h" #include "internal/thread.h" #include "internal/sanitizers.h" @@ -243,8 +243,8 @@ method_coverage_i(void *vstart, void *vend, size_t stride, void *data) VALUE ncoverages = *(VALUE*)data, v; for (v = (VALUE)vstart; v != (VALUE)vend; v += stride) { - void *poisoned = asan_poisoned_object_p(v); - asan_unpoison_object(v, false); + void *poisoned = rb_asan_poisoned_object_p(v); + rb_asan_unpoison_object(v, false); if (RB_TYPE_P(v, T_IMEMO) && imemo_type(v) == imemo_ment) { const rb_method_entry_t *me = (rb_method_entry_t *) v; @@ -287,7 +287,7 @@ method_coverage_i(void *vstart, void *vend, size_t stride, void *data) } if (poisoned) { - asan_poison_object(v); + rb_asan_poison_object(v); } } return 0; @@ -337,7 +337,7 @@ coverage_peek_result_i(st_data_t key, st_data_t val, st_data_t h) * Coverage.peek_result => hash * * Returns a hash that contains filename as key and coverage array as value. - * This is the same as `Coverage.result(stop: false, clear: false)`. + * This is the same as <tt>Coverage.result(stop: false, clear: false)</tt>. * * { * "file.rb" => [1, 2, nil], @@ -352,8 +352,8 @@ rb_coverage_peek_result(VALUE klass) if (!RTEST(coverages)) { rb_raise(rb_eRuntimeError, "coverage measurement is not enabled"); } - OBJ_WB_UNPROTECT(coverages); - st_foreach(RHASH_TBL_RAW(coverages), coverage_peek_result_i, ncoverages); + + rb_hash_foreach(coverages, coverage_peek_result_i, ncoverages); if (current_mode & COVERAGE_TARGET_METHODS) { rb_objspace_each_objects(method_coverage_i, &ncoverages); @@ -467,7 +467,7 @@ rb_coverage_running(VALUE klass) return current_state == RUNNING ? Qtrue : Qfalse; } -/* Coverage provides coverage measurement feature for Ruby. +/* \Coverage provides coverage measurement feature for Ruby. * This feature is experimental, so these APIs may be changed in future. * * Caveat: Currently, only process-global coverage measurement is supported. @@ -503,7 +503,7 @@ rb_coverage_running(VALUE klass) * require "foo.rb" * p Coverage.result #=> {"foo.rb"=>[1, 1, 10, nil, nil, 1, 1, nil, 0, nil]} * - * == Lines Coverage + * == Lines \Coverage * * If a coverage mode is not explicitly specified when starting coverage, lines * coverage is what will run. It reports the number of line executions for each @@ -523,7 +523,7 @@ rb_coverage_running(VALUE klass) * A +nil+ value means coverage is disabled for this line (lines like +else+ * and +end+). * - * == Oneshot Lines Coverage + * == Oneshot Lines \Coverage * * Oneshot lines coverage tracks and reports on the executed lines while * coverage is running. It will not report how many times a line was executed, @@ -537,7 +537,7 @@ rb_coverage_running(VALUE klass) * The value of the oneshot lines coverage result is an array containing the * line numbers that were executed. * - * == Branches Coverage + * == Branches \Coverage * * Branches coverage reports how many times each branch within each conditional * was executed. @@ -562,7 +562,7 @@ rb_coverage_running(VALUE klass) * 5. The ending line number it appears on in the file. * 6. The ending column number it appears on in the file. * - * == Methods Coverage + * == Methods \Coverage * * Methods coverage reports how many times each method was executed. * @@ -600,7 +600,7 @@ rb_coverage_running(VALUE klass) * 5. The ending line number the method appears on in the file. * 6. The ending column number the method appears on in the file. * - * == All Coverage Modes + * == All \Coverage Modes * * You can also run all modes of coverage simultaneously with this shortcut. * Note that running all coverage modes does not run both lines and oneshot |
