mini_racer 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e5a04547a573a909331f603c61e5447e7a409d726ecc0a3ee8d61069f81c04e
4
- data.tar.gz: 9771b199cddccb8da22c3f25a32be2f93fae98d6160cb1ba990839dbbd05d1a8
3
+ metadata.gz: 90d5084c78cd0f28234ab0990db86169bdc6cc9b9f1dd36dca8c53568a5baa54
4
+ data.tar.gz: 3afba3cadc22350a49a43208ba8d2e6915648f7e54e23137191ffd0890c71dcd
5
5
  SHA512:
6
- metadata.gz: ae96b9f758750752d6e7aeb56bfe84181f605a3cbd22a36e7c788fc530c8a2e1cd8f2c549b13100cf34d57278477537f1e52d60522482c9e466b6bf14ae439b9
7
- data.tar.gz: 60d8753bce6d2d4e95f3c4d233e20c9371bfcb9b321d183eab358e6c374f9c3a2dc401d5c8be9d57994700fdb4c62e26c41e8423939e77502837cd1339873d8b
6
+ metadata.gz: 6ed1e268ed3ba3f38662448f0f18f363659f9929fc15ca60eb4f622efbc4dbbd507ab83b77fbe83d8d482ae2d48c501c843f94e5dd2e1e1c250c6e28cefd93c9
7
+ data.tar.gz: 76fe13afa08283976eb7ab2b8d48e1443bd59eddf3cc7f8ae5479538fe6ca1e3ff14e1c3b8d15561e48257bc9d84ddb5e5cc7fdfab9260c837ed33e0d94ab473
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ - 0.15.0 - 05-09-2024
2
+
3
+ - Use libv8-node 22.7.0 - this corrects issues with multithreaded behavior and forking in single threaded mode.
4
+
5
+ - 0.14.1 - 14-08-2024
6
+
7
+ - No longer use mini_racer_loader if LD_PRELOAD is defined and adds a malloc provider. This resolves segfaults when people LD_PRELOAD jemalloc or tcmalloc.
1
8
 
2
9
  - 0.14.0 - 06-08-2024
3
10
 
@@ -115,7 +115,7 @@ failed:
115
115
  rb_raise(rb_eLoadError, "%s", error);
116
116
  }
117
117
 
118
- __attribute__((visibility("default"))) void Init_mini_racer_loader()
118
+ __attribute__((visibility("default"))) void Init_mini_racer_loader(void)
119
119
  {
120
120
  VALUE mMiniRacer = rb_define_module("MiniRacer");
121
121
  VALUE mLoader = rb_define_module_under(mMiniRacer, "Loader");
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MiniRacer
4
- VERSION = "0.14.0"
5
- LIBV8_NODE_VERSION = "~> 18.19.0.0"
4
+ VERSION = "0.15.0"
5
+ LIBV8_NODE_VERSION = "~> 22.7.0.1"
6
6
  end
data/lib/mini_racer.rb CHANGED
@@ -4,14 +4,23 @@ require "pathname"
4
4
  if RUBY_ENGINE == "truffleruby"
5
5
  require "mini_racer/truffleruby"
6
6
  else
7
- require "mini_racer_loader"
8
- ext_filename = "mini_racer_extension.#{RbConfig::CONFIG['DLEXT']}"
9
- ext_path = Gem.loaded_specs['mini_racer'].require_paths
10
- .map { |p| (p = Pathname.new(p)).absolute? ? p : Pathname.new(__dir__).parent + p }
11
- ext_found = ext_path.map { |p| p + ext_filename }.find { |p| p.file? }
12
-
13
- raise LoadError, "Could not find #{ext_filename} in #{ext_path.map(&:to_s)}" unless ext_found
14
- MiniRacer::Loader.load(ext_found.to_s)
7
+ if ENV["LD_PRELOAD"].to_s.include?("malloc")
8
+ require "mini_racer_extension"
9
+ else
10
+ require "mini_racer_loader"
11
+ ext_filename = "mini_racer_extension.#{RbConfig::CONFIG["DLEXT"]}"
12
+ ext_path =
13
+ Gem.loaded_specs["mini_racer"].require_paths.map do |p|
14
+ (p = Pathname.new(p)).absolute? ? p : Pathname.new(__dir__).parent + p
15
+ end
16
+ ext_found = ext_path.map { |p| p + ext_filename }.find { |p| p.file? }
17
+
18
+ unless ext_found
19
+ raise LoadError,
20
+ "Could not find #{ext_filename} in #{ext_path.map(&:to_s)}"
21
+ end
22
+ MiniRacer::Loader.load(ext_found.to_s)
23
+ end
15
24
  end
16
25
 
17
26
  require "thread"
@@ -307,6 +316,7 @@ module MiniRacer
307
316
  @last_eval = Process.clock_gettime(Process::CLOCK_MONOTONIC)
308
317
  @ensure_gc_mutex.synchronize do
309
318
  @ensure_gc_thread = nil if !@ensure_gc_thread&.alive?
319
+ return if !Thread.main.alive? # avoid "can't alloc thread" exception
310
320
  @ensure_gc_thread ||= Thread.new do
311
321
  ensure_gc_after_idle_seconds = @ensure_gc_after_idle / 1000.0
312
322
  done = false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_racer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-06 00:00:00.000000000 Z
11
+ date: 2024-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 18.19.0.0
89
+ version: 22.7.0.1
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 18.19.0.0
96
+ version: 22.7.0.1
97
97
  description: Minimal embedded v8 engine for Ruby
98
98
  email:
99
99
  - sam.saffron@gmail.com
@@ -119,9 +119,9 @@ licenses:
119
119
  - MIT
120
120
  metadata:
121
121
  bug_tracker_uri: https://github.com/discourse/mini_racer/issues
122
- changelog_uri: https://github.com/discourse/mini_racer/blob/v0.14.0/CHANGELOG
123
- documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.14.0
124
- source_code_uri: https://github.com/discourse/mini_racer/tree/v0.14.0
122
+ changelog_uri: https://github.com/discourse/mini_racer/blob/v0.15.0/CHANGELOG
123
+ documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.15.0
124
+ source_code_uri: https://github.com/discourse/mini_racer/tree/v0.15.0
125
125
  post_install_message:
126
126
  rdoc_options: []
127
127
  require_paths: