diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 80a935b30f9ff7..03e75ad445ad9c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -95,6 +95,7 @@ jobs: key: windows-${{ matrix.os }}-vcpkg-${{ hashFiles('src/vcpkg.json') }} - name: Install libraries with vcpkg + id: build-vcpkg run: | git -C "%VCPKG_INSTALLATION_ROOT%" pull --quiet vcpkg install @@ -106,7 +107,13 @@ jobs: with: path: src\vcpkg_installed key: windows-${{ matrix.os }}-vcpkg-${{ hashFiles('src/vcpkg.json') }} - if: ${{ ! steps.restore-vcpkg.outputs.cache-hit && (github.ref_name == 'master' || startsWith(github.ref_name, 'ruby_')) }} + if: >- + steps.build-vcpkg.outcome == 'success' && + ( github.ref_name == 'master' + || startsWith(github.ref_name, 'ruby_') + || ( github.event.pull_request.user.login == 'dependabot[bot]' + && startsWith(github.head_ref || github.ref_name, 'dependabot/vcpkg')) + ) - name: setup env # Available Ruby versions: https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md#ruby diff --git a/NEWS.md b/NEWS.md index 501b894c67264e..9ff290ad754c78 100644 --- a/NEWS.md +++ b/NEWS.md @@ -105,8 +105,8 @@ releases. * minitest 6.0.6 * rake 13.4.2 * 13.3.1 to [v13.4.0][rake-v13.4.0], [v13.4.1][rake-v13.4.1], [v13.4.2][rake-v13.4.2] -* test-unit 3.7.7 - * 3.7.5 to [3.7.6][test-unit-3.7.6], [3.7.7][test-unit-3.7.7] +* test-unit 3.7.8 + * 3.7.5 to [3.7.6][test-unit-3.7.6], [3.7.7][test-unit-3.7.7], [3.7.8][test-unit-3.7.8] * net-imap 0.6.4 * 0.6.2 to [v0.6.3][net-imap-v0.6.3], [v0.6.4][net-imap-v0.6.4] * rbs 4.0.2 @@ -242,6 +242,7 @@ A lot of work has gone into making Ractors more stable, performant, and usable. [rake-v13.4.2]: https://github.com/ruby/rake/releases/tag/v13.4.2 [test-unit-3.7.6]: https://github.com/test-unit/test-unit/releases/tag/3.7.6 [test-unit-3.7.7]: https://github.com/test-unit/test-unit/releases/tag/3.7.7 +[test-unit-3.7.8]: https://github.com/test-unit/test-unit/releases/tag/3.7.8 [net-imap-v0.6.3]: https://github.com/ruby/net-imap/releases/tag/v0.6.3 [net-imap-v0.6.4]: https://github.com/ruby/net-imap/releases/tag/v0.6.4 [rbs-v3.10.1]: https://github.com/ruby/rbs/releases/tag/v3.10.1 diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c index 110b5f6b323864..82853633baa9ca 100644 --- a/ext/json/generator/generator.c +++ b/ext/json/generator/generator.c @@ -724,7 +724,11 @@ static void State_compact(void *ptr) static size_t State_memsize(const void *ptr) { +#ifdef HAVE_RUBY_TYPED_EMBEDDABLE + return 0; +#else return sizeof(JSON_Generator_State); +#endif } static const rb_data_type_t JSON_Generator_State_type = { diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c index eb7dc9aa8218cf..ca082812e65bd2 100644 --- a/ext/json/parser/parser.c +++ b/ext/json/parser/parser.c @@ -243,7 +243,7 @@ static void rvalue_stack_mark(void *ptr) long index; if (stack && stack->ptr) { for (index = 0; index < stack->head; index++) { - rb_gc_mark(stack->ptr[index]); + rb_gc_mark_movable(stack->ptr[index]); } } } @@ -268,7 +268,22 @@ static void rvalue_stack_free(void *ptr) static size_t rvalue_stack_memsize(const void *ptr) { const rvalue_stack *stack = (const rvalue_stack *)ptr; - return sizeof(rvalue_stack) + sizeof(VALUE) * stack->capa; + size_t memsize = sizeof(VALUE) * stack->capa; +#ifndef HAVE_RUBY_TYPED_EMBEDDABLE + memsize += sizeof(rvalue_stack); +#endif + return memsize; +} + +static void rvalue_stack_compact(void *ptr) +{ + rvalue_stack *stack = (rvalue_stack *)ptr; + long index; + if (stack && stack->ptr) { + for (index = 0; index < stack->head; index++) { + stack->ptr[index] = rb_gc_location(stack->ptr[index]); + } + } } static const rb_data_type_t JSON_Parser_rvalue_stack_type = { @@ -277,6 +292,7 @@ static const rb_data_type_t JSON_Parser_rvalue_stack_type = { .dmark = rvalue_stack_mark, .dfree = rvalue_stack_free, .dsize = rvalue_stack_memsize, + .dcompact = rvalue_stack_compact, }, .flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_EMBEDDABLE, }; @@ -452,7 +468,12 @@ static void json_frame_stack_free(void *ptr) static size_t json_frame_stack_memsize(const void *ptr) { const json_frame_stack *stack = (const json_frame_stack *)ptr; - return sizeof(json_frame_stack) + sizeof(json_frame) * stack->capa; + + size_t memsize = sizeof(json_frame) * stack->capa; +#ifndef HAVE_RUBY_TYPED_EMBEDDABLE + memsize += sizeof(json_frame_stack); +#endif + return memsize; } static const rb_data_type_t JSON_Parser_frame_stack_type = { @@ -1955,21 +1976,33 @@ static VALUE cParser_m_parse(VALUE klass, VALUE Vsource, VALUE opts) static void JSON_ParserConfig_mark(void *ptr) { JSON_ParserConfig *config = ptr; - rb_gc_mark(config->on_load_proc); - rb_gc_mark(config->decimal_class); + rb_gc_mark_movable(config->on_load_proc); + rb_gc_mark_movable(config->decimal_class); } static size_t JSON_ParserConfig_memsize(const void *ptr) { +#ifdef HAVE_RUBY_TYPED_EMBEDDABLE + return 0; +#else return sizeof(JSON_ParserConfig); +#endif +} + +static void JSON_ParserConfig_compact(void *ptr) +{ + JSON_ParserConfig *config = ptr; + config->on_load_proc = rb_gc_location(config->on_load_proc); + config->decimal_class = rb_gc_location(config->decimal_class); } static const rb_data_type_t JSON_ParserConfig_type = { .wrap_struct_name = "JSON::Ext::Parser/ParserConfig", .function = { - JSON_ParserConfig_mark, - RUBY_DEFAULT_FREE, - JSON_ParserConfig_memsize, + .dmark = JSON_ParserConfig_mark, + .dfree = RUBY_DEFAULT_FREE, + .dsize = JSON_ParserConfig_memsize, + .dcompact = JSON_ParserConfig_compact, }, .flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_FROZEN_SHAREABLE | RUBY_TYPED_EMBEDDABLE, }; diff --git a/gems/bundled_gems b/gems/bundled_gems index 8e244af59810c3..14f79ce9ae6f2b 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -9,7 +9,7 @@ minitest 6.0.6 https://github.com/minitest/minitest power_assert 3.0.1 https://github.com/ruby/power_assert rake 13.4.2 https://github.com/ruby/rake -test-unit 3.7.7 https://github.com/test-unit/test-unit +test-unit 3.7.8 https://github.com/test-unit/test-unit rexml 3.4.4 https://github.com/ruby/rexml rss 0.3.2 https://github.com/ruby/rss net-imap 0.6.4 https://github.com/ruby/net-imap diff --git a/vcpkg.json b/vcpkg.json index 64d73c40481ccc..c2caad14cddf8a 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -7,5 +7,5 @@ "openssl", "zlib" ], - "builtin-baseline": "56bb2411609227288b70117ead2c47585ba07713" + "builtin-baseline": "f3e10653cc27d62a37a3763cd84b38bca07c6075" } \ No newline at end of file