mini_racer 0.2.9 → 0.2.10

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: 97112de9fedf9f005d85b2325d129a6689ac7b878da020db8caf13c4921e0a92
4
- data.tar.gz: 20cdb63b3661c0626ff4edcf033380a6f59317265d84ecaa24df279d1a7acc39
3
+ metadata.gz: a50c6aea93635efc351ce95def252df6edb3fbede6a0372272f8c9cd58f9aaed
4
+ data.tar.gz: b01cd6a98eca13db18d539ed259e4acd968eb073582979ff06f78a5df54a4207
5
5
  SHA512:
6
- metadata.gz: e2db9f72fa5869a7e9c31ee1b9ef8215e07afb672f6142bf67fc3b509627c594f0e7282fd71bf62b64efb2cbe560a9bdf54615a0e522bc8d57e919746861dc02
7
- data.tar.gz: dc844371d224fbbb7eebdc638282f5c9ee0250d3a09fd4a1fc1de1a7f0ef741bfb87e485f17048017ab7d1c4e34bed0a582d367ac0c603cb0ee738ea108e3d26
6
+ metadata.gz: cac0258ac9f1f93245b00b313d004504d770e9dce3eb5ac9a8d547a1b24cd3649ec9039d9c7429ff7871f9f8d3c07e260997d86647905ba433688f361bd72611
7
+ data.tar.gz: b054a38013e7bcffe689c3732d7d95abbaf61c350dab275ff7e04e667bc5f15ae9863a706beb2848681b8d69cc1194c0bb87014a4c49e2f49d14a4289b1f6436
@@ -1,9 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3
4
3
  - 2.4
5
4
  - 2.5
6
5
  - 2.6
6
+ - 2.7
7
7
  - ruby-head
8
8
  matrix:
9
9
  include:
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ - 0.2.10
2
+
3
+ - 22-04-2020
4
+
5
+ - FEATURE: memory softlimit support for nogvl_context_call
6
+
1
7
  - 0.2.9
2
8
 
3
9
  - 09-01-2020
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MiniRacer
2
2
 
3
- [![Build Status](https://travis-ci.org/discourse/mini_racer.svg?branch=master)](https://travis-ci.org/discourse/mini_racer)
3
+ [![Build Status](https://travis-ci.org/rubyjs/mini_racer.svg?branch=master)](https://travis-ci.org/rubyjs/mini_racer)
4
4
 
5
5
  Minimal, modern embedded V8 for Ruby.
6
6
 
@@ -273,7 +273,7 @@ context.eval js
273
273
  The same code without the harmony runtime flag results in a `MiniRacer::RuntimeError: RangeError: Maximum call stack size exceeded` exception.
274
274
  Please refer to http://node.green/ as a reference on other harmony features.
275
275
 
276
- A list of all V8 runtime flags can be found using `node --v8-options`, or else by perusing [the V8 source code for flags (make sure to use the right version of V8)](https://github.com/v8/v8/blob/master/src/flag-definitions.h).
276
+ A list of all V8 runtime flags can be found using `node --v8-options`, or else by perusing [the V8 source code for flags (make sure to use the right version of V8)](https://github.com/v8/v8/blob/master/src/flags/flag-definitions.h).
277
277
 
278
278
  Note that runtime flags must be set before any other operation (e.g. creating a context, a snapshot or an isolate), otherwise an exception will be thrown.
279
279
 
@@ -447,7 +447,7 @@ Add this to your .travis.yml file:
447
447
 
448
448
  ## Contributing
449
449
 
450
- Bug reports and pull requests are welcome on GitHub at https://github.com/discourse/mini_racer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
450
+ Bug reports and pull requests are welcome on GitHub at https://github.com/rubyjs/mini_racer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
451
451
 
452
452
 
453
453
  ## License
@@ -127,6 +127,7 @@ typedef struct {
127
127
  Local<Function> fun;
128
128
  Local<Value> *argv;
129
129
  EvalResult result;
130
+ size_t max_memory;
130
131
  } FunctionCall;
131
132
 
132
133
  enum IsolateFlags {
@@ -1454,6 +1455,12 @@ nogvl_context_call(void *args) {
1454
1455
  // terminate ASAP
1455
1456
  isolate->SetData(DO_TERMINATE, (void*)false);
1456
1457
 
1458
+ if (call->max_memory > 0) {
1459
+ isolate->SetData(MEM_SOFTLIMIT_VALUE, &call->max_memory);
1460
+ isolate->SetData(MEM_SOFTLIMIT_REACHED, (void*)false);
1461
+ isolate->AddGCEpilogueCallback(gc_callback);
1462
+ }
1463
+
1457
1464
  Isolate::Scope isolate_scope(isolate);
1458
1465
  EscapableHandleScope handle_scope(isolate);
1459
1466
  TryCatch trycatch(isolate);
@@ -1511,6 +1518,13 @@ static VALUE rb_context_call_unsafe(int argc, VALUE *argv, VALUE self) {
1511
1518
  call_argv = argv + 1;
1512
1519
  }
1513
1520
 
1521
+ call.max_memory = 0;
1522
+ VALUE mem_softlimit = rb_iv_get(self, "@max_memory");
1523
+ if (mem_softlimit != Qnil) {
1524
+ unsigned long sl_int = NUM2ULONG(mem_softlimit);
1525
+ call.max_memory = (size_t)sl_int;
1526
+ }
1527
+
1514
1528
  bool missingFunction = false;
1515
1529
  {
1516
1530
  Locker lock(isolate);
@@ -1,3 +1,3 @@
1
1
  module MiniRacer
2
- VERSION = "0.2.9"
2
+ VERSION = "0.2.10"
3
3
  end
@@ -26,12 +26,12 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_development_dependency "bundler", "~> 1.12"
29
+ spec.add_development_dependency "bundler"
30
30
  spec.add_development_dependency "rake", "~> 10.0"
31
31
  spec.add_development_dependency "minitest", "~> 5.0"
32
32
  spec.add_development_dependency "rake-compiler"
33
33
 
34
- spec.add_dependency 'libv8', '>= 6.9.411'
34
+ spec.add_dependency 'libv8', '> 7.3'
35
35
  spec.require_paths = ["lib", "ext"]
36
36
 
37
37
  spec.extensions = ["ext/mini_racer_extension/extconf.rb"]
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_racer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-09 00:00:00.000000000 Z
11
+ date: 2020-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.12'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: libv8
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - ">"
74
74
  - !ruby/object:Gem::Version
75
- version: 6.9.411
75
+ version: '7.3'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - ">"
81
81
  - !ruby/object:Gem::Version
82
- version: 6.9.411
82
+ version: '7.3'
83
83
  description: Minimal embedded v8 engine for Ruby
84
84
  email:
85
85
  - sam.saffron@gmail.com
@@ -108,9 +108,9 @@ licenses:
108
108
  - MIT
109
109
  metadata:
110
110
  bug_tracker_uri: https://github.com/discourse/mini_racer/issues
111
- changelog_uri: https://github.com/discourse/mini_racer/blob/v0.2.9/CHANGELOG
112
- documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.2.9
113
- source_code_uri: https://github.com/discourse/mini_racer/tree/v0.2.9
111
+ changelog_uri: https://github.com/discourse/mini_racer/blob/v0.2.10/CHANGELOG
112
+ documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.2.10
113
+ source_code_uri: https://github.com/discourse/mini_racer/tree/v0.2.10
114
114
  post_install_message:
115
115
  rdoc_options: []
116
116
  require_paths: