Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ releases.
* ipaddr 1.2.9
* 1.2.8 to [v1.2.9][ipaddr-v1.2.9]
* json 2.21.0
* 2.18.0 to [v2.18.1][json-v2.18.1], [v2.19.0][json-v2.19.0], [v2.19.1][json-v2.19.1], [v2.19.2][json-v2.19.2], [v2.19.3][json-v2.19.3], [v2.19.4][json-v2.19.4], [v2.19.5][json-v2.19.5], [v2.19.6][json-v2.19.6], [v2.19.7][json-v2.19.7], [v2.19.8][json-v2.19.8], [v2.19.9][json-v2.19.9], [v2.20.0][json-v2.20.0]
* 2.18.0 to [v2.18.1][json-v2.18.1], [v2.19.0][json-v2.19.0], [v2.19.1][json-v2.19.1], [v2.19.2][json-v2.19.2], [v2.19.3][json-v2.19.3], [v2.19.4][json-v2.19.4], [v2.19.5][json-v2.19.5], [v2.19.6][json-v2.19.6], [v2.19.7][json-v2.19.7], [v2.19.8][json-v2.19.8], [v2.19.9][json-v2.19.9], [v2.20.0][json-v2.20.0], [v2.21.0][json-v2.21.0]
* openssl 4.0.2
* 4.0.0 to [v4.0.1][openssl-v4.0.1], [v4.0.2][openssl-v4.0.2]
* pp 0.6.4
Expand Down Expand Up @@ -270,6 +270,7 @@ A lot of work has gone into making Ractors more stable, performant, and usable.
[json-v2.19.8]: https://github.com/ruby/json/releases/tag/v2.19.8
[json-v2.19.9]: https://github.com/ruby/json/releases/tag/v2.19.9
[json-v2.20.0]: https://github.com/ruby/json/releases/tag/v2.20.0
[json-v2.21.0]: https://github.com/ruby/json/releases/tag/v2.21.0
[openssl-v4.0.1]: https://github.com/ruby/openssl/releases/tag/v4.0.1
[openssl-v4.0.2]: https://github.com/ruby/openssl/releases/tag/v4.0.2
[pp-v0.6.4]: https://github.com/ruby/pp/releases/tag/v0.6.4
Expand Down
6 changes: 5 additions & 1 deletion ext/stringio/stringio.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,18 @@ strio_memsize(const void *p)
return sizeof(struct StringIO);
}

#ifndef RUBY_TYPED_THREAD_SAFE_FREE
#define RUBY_TYPED_THREAD_SAFE_FREE RUBY_TYPED_FREE_IMMEDIATELY
#endif

static const rb_data_type_t strio_data_type = {
"strio",
{
strio_mark,
strio_free,
strio_memsize,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED
0, 0, RUBY_TYPED_THREAD_SAFE_FREE | RUBY_TYPED_WB_PROTECTED
};

#define check_strio(self) ((struct StringIO*)rb_check_typeddata((self), &strio_data_type))
Expand Down
6 changes: 5 additions & 1 deletion ext/strscan/strscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ strscan_memsize(const void *ptr)
return size;
}

#ifndef RUBY_TYPED_THREAD_SAFE_FREE
#define RUBY_TYPED_THREAD_SAFE_FREE RUBY_TYPED_FREE_IMMEDIATELY
#endif

static const rb_data_type_t strscanner_type = {
.wrap_struct_name = "StringScanner",
.function = {
Expand All @@ -248,7 +252,7 @@ static const rb_data_type_t strscanner_type = {
.dcompact = strscan_compact,
#endif
},
.flags = RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_EMBEDDABLE
.flags = RUBY_TYPED_THREAD_SAFE_FREE | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_EMBEDDABLE
};

static VALUE
Expand Down
10 changes: 5 additions & 5 deletions spec/ruby/core/integer/bit_count_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
end

it "raises an ArgumentError for a negative number" do
-> { -1.bit_count }.should raise_error(ArgumentError)
-> { -19.bit_count }.should raise_error(ArgumentError)
-> { fixnum_min.bit_count }.should raise_error(ArgumentError)
-> { (-2**1000).bit_count }.should raise_error(ArgumentError)
-> { (-2**1000 - 1).bit_count }.should raise_error(ArgumentError)
-> { -1.bit_count }.should.raise(ArgumentError)
-> { -19.bit_count }.should.raise(ArgumentError)
-> { fixnum_min.bit_count }.should.raise(ArgumentError)
-> { (-2**1000).bit_count }.should.raise(ArgumentError)
-> { (-2**1000 - 1).bit_count }.should.raise(ArgumentError)
end
end
end
20 changes: 16 additions & 4 deletions win32/rm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,23 @@ goto :remove_end
::- files under the target directory, instead of the symlink itself.
rd /q "%p%" 2> nul && goto :remove_end

::- If matching files and directory exist, remove the files only first.
del /q "%p%" 2> nul

::- `del` exits with 0 even when nothing matched, so its result cannot
::- tell whether directories remain; remove them first.
if "%recursive%" == "-r" for /D %%I in (%p%) do (
rd /s /q %%I || call set error=%%ERRORLEVEL%%
::- tell whether directories remain; check if matching entries still
::- exist instead.
if not exist "%p%" goto :remove_end

::- Unless `-r` option is given, do not remove directories; just fail.
if not "%recursive%" == "-r" (
call set error=1
goto :remove_end
)

::- Remove remained directories recursively.
for /D %%I in (%p%) do (
rd /s /q %%I 2> nul || call set error=%%ERRORLEVEL%%
)
if exist "%p%" del /q "%p%" 2> nul
:remove_end
endlocal & set "error=%error%" & goto :EOF