diff --git a/lib/memory_profiler/autorun.rb b/lib/memory_profiler/autorun.rb index 745dfd3..8f600eb 100644 --- a/lib/memory_profiler/autorun.rb +++ b/lib/memory_profiler/autorun.rb @@ -1,10 +1,9 @@ # frozen_string_literal: true require "memory_profiler" -require "base64" def deserialize_hash(data) - Marshal.load(Base64.urlsafe_decode64(data)) if data + Marshal.load(data.unpack1("m0")) if data end options = deserialize_hash(ENV["MEMORY_PROFILER_OPTIONS"]) || {} diff --git a/lib/memory_profiler/cli.rb b/lib/memory_profiler/cli.rb index ee8a613..e55bd9c 100644 --- a/lib/memory_profiler/cli.rb +++ b/lib/memory_profiler/cli.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require "optparse" -require "base64" module MemoryProfiler class CLI @@ -141,7 +140,7 @@ def profile_command(options, argv) end def serialize_hash(hash) - Base64.urlsafe_encode64(Marshal.dump(hash)) + [Marshal.dump(hash)].pack("m0") end end end