mini_racer 0.17.0.pre11 → 0.17.0.pre13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/ext/mini_racer_extension/mini_racer_extension.c +21 -21
- data/ext/mini_racer_extension/mini_racer_v8.cc +1 -12
- data/lib/mini_racer/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02c93cf015b4c5e591ce5f6b3f61b787c3c12ea1d98b33dde6879461140ef9bd
|
4
|
+
data.tar.gz: f77c6dbdee02fedcea41a2fe077aa71bc30c2c0dbc0630a1c09ebc90f075e4a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b9370d3e4aa2bb017e9c450651381bc3b11880bcfee9448949cdc1cb0a7c01a3bb0836112c10a32d2f9c199c687cea16a5374142e9ba5201b5c526e524b09dc
|
7
|
+
data.tar.gz: fecf25f26fa787280cc22eccd13deeee4dd554a36ee23e347149bc4e6d34b6a5eab623b8454d6ad0b6ad685e06e47cf8d45625ee015b033a1ed115ffb931e181
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
- 0.17.0.pre13 - 04-02-2025
|
2
|
+
- Only issue idle GC once post dispatch - reduces CPU usage for auto cleanup - Sam Saffron
|
3
|
+
|
4
|
+
- 0.17.0.pre12 - 23-01-2025
|
5
|
+
- Corrected off-by-one error with object serialization - Ben Noordhuis
|
6
|
+
|
1
7
|
- 0.17.0.pre11 - 21-01-2025
|
2
8
|
- Corrected encoding bug with deserialization of strings - Ben Noordhuis
|
3
9
|
|
@@ -611,6 +611,13 @@ static int serialize1(Ser *s, VALUE refs, VALUE v)
|
|
611
611
|
return 0;
|
612
612
|
}
|
613
613
|
|
614
|
+
// don't mix with ser_array_begin/ser_object_begin because
|
615
|
+
// that will throw off the object reference count
|
616
|
+
static int serialize(Ser *s, VALUE v)
|
617
|
+
{
|
618
|
+
return serialize1(s, rb_hash_new(), v);
|
619
|
+
}
|
620
|
+
|
614
621
|
static struct timespec deadline_ms(int ms)
|
615
622
|
{
|
616
623
|
static const int64_t ns_per_sec = 1000*1000*1000;
|
@@ -721,6 +728,7 @@ static void dispatch(Context *c)
|
|
721
728
|
void v8_thread_main(Context *c, struct State *pst)
|
722
729
|
{
|
723
730
|
struct timespec deadline;
|
731
|
+
bool issued_idle_gc = true;
|
724
732
|
|
725
733
|
c->pst = pst;
|
726
734
|
barrier_wait(&c->late_init);
|
@@ -730,8 +738,10 @@ void v8_thread_main(Context *c, struct State *pst)
|
|
730
738
|
if (c->idle_gc > 0) {
|
731
739
|
deadline = deadline_ms(c->idle_gc);
|
732
740
|
pthread_cond_timedwait(&c->cv, &c->mtx, &deadline);
|
733
|
-
if (deadline_exceeded(deadline))
|
741
|
+
if (deadline_exceeded(deadline) && !issued_idle_gc) {
|
734
742
|
v8_low_memory_notification(c->pst);
|
743
|
+
issued_idle_gc = true;
|
744
|
+
}
|
735
745
|
} else {
|
736
746
|
pthread_cond_wait(&c->cv, &c->mtx);
|
737
747
|
}
|
@@ -739,6 +749,7 @@ void v8_thread_main(Context *c, struct State *pst)
|
|
739
749
|
if (!c->req.len)
|
740
750
|
continue; // spurious wakeup or quit signal from other thread
|
741
751
|
dispatch(c);
|
752
|
+
issued_idle_gc = false;
|
742
753
|
pthread_cond_signal(&c->cv);
|
743
754
|
}
|
744
755
|
}
|
@@ -859,18 +870,11 @@ static void *rendezvous_callback(void *arg)
|
|
859
870
|
goto fail;
|
860
871
|
}
|
861
872
|
ser_init1(&s, 'c'); // callback reply
|
862
|
-
|
863
|
-
// either [result, undefined] or [undefined, err]
|
864
|
-
if (exc)
|
865
|
-
ser_undefined(&s);
|
866
|
-
if (serialize1(&s, rb_hash_new(), r)) { // should not happen
|
873
|
+
if (serialize(&s, r)) { // should not happen
|
867
874
|
c->exception = rb_exc_new_cstr(internal_error, s.err);
|
868
875
|
ser_reset(&s);
|
869
876
|
goto fail;
|
870
877
|
}
|
871
|
-
if (!exc)
|
872
|
-
ser_undefined(&s);
|
873
|
-
ser_array_end(&s, 2);
|
874
878
|
out:
|
875
879
|
buf_move(&s.b, a->req);
|
876
880
|
return NULL;
|
@@ -1202,25 +1206,21 @@ static VALUE context_stop(VALUE self)
|
|
1202
1206
|
|
1203
1207
|
static VALUE context_call(int argc, VALUE *argv, VALUE self)
|
1204
1208
|
{
|
1205
|
-
VALUE
|
1209
|
+
VALUE name, args;
|
1210
|
+
VALUE a, e;
|
1206
1211
|
Context *c;
|
1207
|
-
int i;
|
1208
1212
|
Ser s;
|
1209
1213
|
|
1210
1214
|
TypedData_Get_Struct(self, Context, &context_type, c);
|
1211
|
-
rb_scan_args(argc, argv, "1*", &
|
1212
|
-
Check_Type(
|
1215
|
+
rb_scan_args(argc, argv, "1*", &name, &args);
|
1216
|
+
Check_Type(name, T_STRING);
|
1217
|
+
rb_ary_unshift(args, name);
|
1213
1218
|
// request is (C)all, [name, args...] array
|
1214
1219
|
ser_init1(&s, 'C');
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
if (serialize1(&s, h, argv[i])) {
|
1219
|
-
ser_reset(&s);
|
1220
|
-
rb_raise(runtime_error, "Context.call: %s", s.err);
|
1221
|
-
}
|
1220
|
+
if (serialize(&s, args)) {
|
1221
|
+
ser_reset(&s);
|
1222
|
+
rb_raise(runtime_error, "Context.call: %s", s.err);
|
1222
1223
|
}
|
1223
|
-
ser_array_end(&s, argc);
|
1224
1224
|
// response is [result, err] array
|
1225
1225
|
a = rendezvous(c, &s.b); // takes ownership of |s.b|
|
1226
1226
|
e = rb_ary_pop(a);
|
@@ -378,18 +378,7 @@ void v8_api_callback(const v8::FunctionCallbackInfo<v8::Value>& info)
|
|
378
378
|
des.ReadHeader(st.context).Check();
|
379
379
|
v8::Local<v8::Value> result;
|
380
380
|
if (!des.ReadValue(st.context).ToLocal(&result)) return; // exception pending
|
381
|
-
|
382
|
-
if (!result->ToObject(st.context).ToLocal(&response)) return;
|
383
|
-
v8::Local<v8::Value> err;
|
384
|
-
if (!response->Get(st.context, 1).ToLocal(&err)) return;
|
385
|
-
if (err->IsUndefined()) {
|
386
|
-
if (!response->Get(st.context, 0).ToLocal(&result)) return;
|
387
|
-
info.GetReturnValue().Set(result);
|
388
|
-
} else {
|
389
|
-
v8::Local<v8::String> message;
|
390
|
-
if (!err->ToString(st.context).ToLocal(&message)) return;
|
391
|
-
st.isolate->ThrowException(v8::Exception::Error(message));
|
392
|
-
}
|
381
|
+
info.GetReturnValue().Set(result);
|
393
382
|
}
|
394
383
|
|
395
384
|
// response is err or empty string
|
data/lib/mini_racer/version.rb
CHANGED
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.17.0.
|
4
|
+
version: 0.17.0.pre13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -123,9 +123,9 @@ licenses:
|
|
123
123
|
- MIT
|
124
124
|
metadata:
|
125
125
|
bug_tracker_uri: https://github.com/discourse/mini_racer/issues
|
126
|
-
changelog_uri: https://github.com/discourse/mini_racer/blob/v0.17.0.
|
127
|
-
documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.17.0.
|
128
|
-
source_code_uri: https://github.com/discourse/mini_racer/tree/v0.17.0.
|
126
|
+
changelog_uri: https://github.com/discourse/mini_racer/blob/v0.17.0.pre13/CHANGELOG
|
127
|
+
documentation_uri: https://www.rubydoc.info/gems/mini_racer/0.17.0.pre13
|
128
|
+
source_code_uri: https://github.com/discourse/mini_racer/tree/v0.17.0.pre13
|
129
129
|
post_install_message:
|
130
130
|
rdoc_options: []
|
131
131
|
require_paths:
|