diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c index 41f33f4fb8c9f3..1b0280b460ab81 100644 --- a/ext/coverage/coverage.c +++ b/ext/coverage/coverage.c @@ -164,14 +164,14 @@ rb_coverage_resume(VALUE klass) /* * call-seq: - * Coverage.start => nil - * Coverage.start(:all) => nil - * Coverage.start(lines: bool, branches: bool, methods: bool, eval: bool) => nil - * Coverage.start(oneshot_lines: true) => nil - * - * Enables the coverage measurement. - * See the documentation of Coverage class in detail. - * This is equivalent to Coverage.setup and Coverage.resume. + * Coverage.start -> nil + * Coverage.start(type) -> nil + * Coverage.start(lines: false, branches: false, methods: false, eval: false, oneshot_lines: false) -> nil + * + * Enables coverage measurement. + * This method is equivalent to calling Coverage.setup with the arguments provided, + * and then calling Coverage.resume. See their respective documentation for more + * details. */ static VALUE rb_coverage_start(int argc, VALUE *argv, VALUE klass) diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb index 734d6987a2518a..5f8099baa2c160 100644 --- a/ext/win32/lib/win32/registry.rb +++ b/ext/win32/lib/win32/registry.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'fiddle/import' +# Generic namespace for Windows platform-specific features. module Win32 # :stopdoc: WCHAR = Encoding::UTF_16LE diff --git a/ext/win32/lib/win32/resolv.rb b/ext/win32/lib/win32/resolv.rb index 8d631a21403f4c..01e1bda351f990 100644 --- a/ext/win32/lib/win32/resolv.rb +++ b/ext/win32/lib/win32/resolv.rb @@ -7,7 +7,7 @@ require 'win32/resolv.so' module Win32 - module Resolv + module Resolv # :nodoc: # Error at Win32 API class Error < StandardError # +code+ Win32 Error code diff --git a/ext/win32/resolv/resolv.c b/ext/win32/resolv/resolv.c index b2d377df9fffc6..9150df5dc11a27 100644 --- a/ext/win32/resolv/resolv.c +++ b/ext/win32/resolv/resolv.c @@ -53,6 +53,7 @@ wchar_to_utf8(const WCHAR *w, int n) return str; } +/* :nodoc: */ static VALUE get_dns_server_list(VALUE self) { @@ -81,7 +82,6 @@ get_dns_server_list(VALUE self) return nameservers; } - static const WCHAR TCPIP_Params[] = L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"; static void @@ -116,6 +116,7 @@ reg_open_key(VALUE klass, HKEY hkey, const WCHAR *wname) return rb_ensure(rb_yield, k, hkey_close, k); } +/* :nodoc: */ static VALUE tcpip_params_open(VALUE klass) { diff --git a/lib/timeout.rb b/lib/timeout.rb index e293e3be7c9eea..eb66e586df20e3 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -305,6 +305,7 @@ def self.timeout(sec, klass = nil, message = nil, &block) #:yield: +sec+ end end + # See Timeout.timeout private def timeout(*args, &block) Timeout.timeout(*args, &block) end diff --git a/ractor_sync.c b/ractor_sync.c index a346ea497bc4a4..809469eeccd763 100644 --- a/ractor_sync.c +++ b/ractor_sync.c @@ -28,27 +28,15 @@ ractor_port_mark(void *ptr) } } -static void -ractor_port_free(void *ptr) -{ - SIZED_FREE((struct ractor_port *)ptr); -} - -static size_t -ractor_port_memsize(const void *ptr) -{ - return sizeof(struct ractor_port); -} - static const rb_data_type_t ractor_port_data_type = { "ractor/port", { ractor_port_mark, - ractor_port_free, - ractor_port_memsize, + RUBY_TYPED_DEFAULT_FREE, + NULL, // memsize NULL, // update }, - 0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FROZEN_SHAREABLE, + 0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FROZEN_SHAREABLE | RUBY_TYPED_EMBEDDABLE, }; static st_data_t @@ -62,8 +50,7 @@ static struct ractor_port * RACTOR_PORT_PTR(VALUE self) { VM_ASSERT(rb_typeddata_is_kind_of(self, &ractor_port_data_type)); - struct ractor_port *rp = DATA_PTR(self); - return rp; + return RTYPEDDATA_GET_DATA(self); } static VALUE