Skip to content
Merged
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
8 changes: 7 additions & 1 deletion lib/pstore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ def transaction(read_only = false) # :yields: pstore
EMPTY_MARSHAL_DATA = Marshal.dump({})
EMPTY_MARSHAL_CHECKSUM = CHECKSUM_ALGO.digest(EMPTY_MARSHAL_DATA)

EMPTY_MARSHAL_DATA.freeze
EMPTY_MARSHAL_CHECKSUM.freeze

#
# Open the specified filename (either in read-only mode or in
# read-write mode) and lock it for reading or writing.
Expand Down Expand Up @@ -428,9 +431,12 @@ def load_data(file, read_only)

def on_windows?
is_windows = RUBY_PLATFORM =~ /mswin|mingw|bccwin|wince/
self.class.__send__(:define_method, :on_windows?) do

on_windows_proc = Proc.new do
is_windows
end
Ractor.make_shareable(on_windows_proc) if defined?(Ractor)
self.class.__send__(:define_method, :on_windows?, &on_windows_proc)
is_windows
end

Expand Down