Skip to content

Commit

Permalink
Version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Sep 15, 2024
1 parent e82bd16 commit a862fc0
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- 0.17.0.pre3 - 15-09-2024

- Text clang based Linux v8 build, in case there is an edge case with GCC compilation

- 0.17.0.pre2 - 09-09-2024

- Test build to see if disabling Maglev optimisations resolves segfault issues
Expand Down
4 changes: 2 additions & 2 deletions lib/mini_racer/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module MiniRacer
VERSION = "0.17.0.pre2"
LIBV8_NODE_VERSION = "~> 22.7.0.3"
VERSION = "0.17.0.pre3"
LIBV8_NODE_VERSION = "~> 22.7.0.4"
end
76 changes: 76 additions & 0 deletions test/test_multithread.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# use bundle exec to run this script
#
require 'securerandom'


context = nil

Thread.new do
require "mini_racer"
context = MiniRacer::Context.new
end.join

Thread.new do
context.isolate.low_memory_notification

start_heap = context.heap_stats[:used_heap_size]

context.eval("'#{"x" * 1_000_000_0}'")


end_heap = context.heap_stats[:used_heap_size]

p end_heap - start_heap
end.join

Thread.new do
10.times do
context.isolate.low_memory_notification
end
end_heap = context.heap_stats[:used_heap_size]
p end_heap
end.join
exit


ctx = nil

big_eval = +""

(0..100).map do |j|
big_regex = (1..10000).map { |i| SecureRandom.hex }.join("|")
big_eval << "X[#{j}] = /#{big_regex}/;\n"
end

big_eval = <<~JS
const X = [];
#{big_eval}
function test(i, str) {
return X[i].test(str);
}
null;
JS

Thread
.new do
require "mini_racer"
ctx = MiniRacer::Context.new
ctx.eval("var a = 1+1")
ctx.eval(big_eval)
end
.join

3.times { GC.start }


Thread
.new do
10.times do
10.times { |i| p ctx.eval "test(#{i}, '#{SecureRandom.hex}')" }
end
end
.join

GC.start

0 comments on commit a862fc0

Please sign in to comment.