leptris 1.9.379.0-aarch64-linux → 1.9.379.2-aarch64-linux
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.md +22 -0
- data/ext/leptris/native/native.c +31 -5
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/native.so +0 -0
- data/lib/leptris/xml/native_3_3.so +0 -0
- data/lib/leptris/xml/native_layer.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b235f58e7de7780990dc11862d1bce77ee33220cb3f0ee61e9124ded829f080d
|
|
4
|
+
data.tar.gz: be5340e4be9d94703638eb74f13f80ccef66f5a8eac3ddb28f9fd9857ef1db95
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1423256a4aa9d071f1441beb8cd48bbc0a5733d8d4bf7363f7135f9872dba50edae6b30e1ddc4353665fa06502087d07e5451a69e8be130cfd05327a33b42bc6
|
|
7
|
+
data.tar.gz: c59457e85190260d802ecf401d088c0f789235549c20350310d1dfd013dd370d556719507c16673818b2cbf07d2f532e4df4471125090ca1c4bcaa172cfa8d7d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [1.9.379.2] - 2026-10-21
|
|
2
|
+
|
|
3
|
+
### Added — native layer
|
|
4
|
+
|
|
5
|
+
- **Unshadowed `set_text_native` alias (the add_child_native
|
|
6
|
+
pattern, leptris/leptris-ruby#525)**: `content=` on the TypedData
|
|
7
|
+
self, one C frame per text write; consumers gate by respond_to?
|
|
8
|
+
and fall back on older exts.
|
|
9
|
+
|
|
10
|
+
## [1.9.379.1] - 2026-10-21
|
|
11
|
+
|
|
12
|
+
### Added — native layer
|
|
13
|
+
|
|
14
|
+
- **The element mint pre-writes the consumer contract in C
|
|
15
|
+
(leptris/leptris-ruby#523)**: `NativeNode.create_element` takes
|
|
16
|
+
optional `(context, adapter)` and writes `@native` (the identity
|
|
17
|
+
contract: the node itself), `@context` and `@adapter` before
|
|
18
|
+
returning, so moxml's builder hot path skips its Ruby prime pass
|
|
19
|
+
per created element. The binding-agnostic consumer gates itself
|
|
20
|
+
by an arity probe; the two-argument call is unchanged for
|
|
21
|
+
existing callers.
|
|
22
|
+
|
|
1
23
|
## [1.9.379.0] - 2026-10-21
|
|
2
24
|
|
|
3
25
|
### Fixed — engine sync (libleptris 1.9.379)
|
data/ext/leptris/native/native.c
CHANGED
|
@@ -205,6 +205,7 @@ static VALUE c_leptris_error;
|
|
|
205
205
|
static VALUE c_b_document, c_b_freed, c_ffi_pointer;
|
|
206
206
|
static ID id_ptr_new, id_freed_new, id_alive;
|
|
207
207
|
static ID id_iv_c_address, id_iv_document, id_iv_parent;
|
|
208
|
+
static ID id_iv_mx_context, id_iv_mx_adapter, id_iv_mx_native;
|
|
208
209
|
static ID id_iv_structure_memoizable, id_iv_native_fast;
|
|
209
210
|
static ID id_iv_pub_document, id_iv_addr_reads_fast, id_iv_node_type;
|
|
210
211
|
static void check_status_c(int st);
|
|
@@ -1411,11 +1412,18 @@ static VALUE nf_insert_binding_child(VALUE self, VALUE document,
|
|
|
1411
1412
|
|
|
1412
1413
|
/* Builder factories (#149): create in C, wrap as NativeNode — no
|
|
1413
1414
|
* FFI::Pointer, no Ruby wrap_fresh path. */
|
|
1414
|
-
static VALUE nn_create_element(
|
|
1415
|
+
static VALUE nn_create_element(int argc, VALUE *argv, VALUE klass)
|
|
1415
1416
|
{
|
|
1417
|
+
VALUE document, name, mx_context, mx_adapter;
|
|
1416
1418
|
void *ptr;
|
|
1417
|
-
VALUE mk
|
|
1419
|
+
VALUE mk, node;
|
|
1418
1420
|
(void)klass;
|
|
1421
|
+
/* Optional (context, adapter): when the consumer passes its
|
|
1422
|
+
* contract state, the mint pre-writes the ivars in C and the
|
|
1423
|
+
* consumer's Ruby prime pass disappears from the build path. */
|
|
1424
|
+
rb_scan_args(argc, argv, "22", &document, &name,
|
|
1425
|
+
&mx_context, &mx_adapter);
|
|
1426
|
+
mk = doc_klass_for_kind(document, 0);
|
|
1419
1427
|
ptr = f_elem_create(doc_ptr_of(document), StringValueCStr(name));
|
|
1420
1428
|
if (!ptr)
|
|
1421
1429
|
rb_raise(c_runtime_error, "leptris_element_create failed");
|
|
@@ -1423,8 +1431,18 @@ static VALUE nn_create_element(VALUE klass, VALUE document, VALUE name)
|
|
|
1423
1431
|
* the unattached create factories are the build path (moxml's
|
|
1424
1432
|
* create_element per record); plain NativeNode here forced the
|
|
1425
1433
|
* consumer into wrapper-mode bridging for the whole document. */
|
|
1426
|
-
if (!NIL_P(mk))
|
|
1427
|
-
|
|
1434
|
+
if (!NIL_P(mk)) {
|
|
1435
|
+
node = mint_consumer_node(mk, document, ptr);
|
|
1436
|
+
if (!NIL_P(mx_context)) {
|
|
1437
|
+
/* The identity contract (#508): @native is the node
|
|
1438
|
+
* itself — exactly what the consumer's prime pass wrote.
|
|
1439
|
+
* Writing it here lets that pass disappear. */
|
|
1440
|
+
rb_ivar_set(node, id_iv_mx_native, node);
|
|
1441
|
+
rb_ivar_set(node, id_iv_mx_context, mx_context);
|
|
1442
|
+
rb_ivar_set(node, id_iv_mx_adapter, mx_adapter);
|
|
1443
|
+
}
|
|
1444
|
+
return node;
|
|
1445
|
+
}
|
|
1428
1446
|
return wrap_new(document, ptr);
|
|
1429
1447
|
}
|
|
1430
1448
|
|
|
@@ -3525,6 +3543,9 @@ LEPTRIS_INIT_EXPORT void Init_native(void)
|
|
|
3525
3543
|
id_iv_binding_cache = rb_intern("@wrapper_cache");
|
|
3526
3544
|
id_iv_c_address = rb_intern("@c_address");
|
|
3527
3545
|
id_iv_document = rb_intern("@document");
|
|
3546
|
+
id_iv_mx_context = rb_intern("@context");
|
|
3547
|
+
id_iv_mx_native = rb_intern("@native");
|
|
3548
|
+
id_iv_mx_adapter = rb_intern("@adapter");
|
|
3528
3549
|
id_iv_parent = rb_intern("@parent");
|
|
3529
3550
|
id_iv_structure_memoizable = rb_intern("@structure_memoizable");
|
|
3530
3551
|
id_iv_native_fast = rb_intern("@native_fast");
|
|
@@ -3552,7 +3573,7 @@ LEPTRIS_INIT_EXPORT void Init_native(void)
|
|
|
3552
3573
|
rb_define_singleton_method(c_native_node, "from", nn_from, 2);
|
|
3553
3574
|
rb_define_singleton_method(c_native_node, "install_child_klasses",
|
|
3554
3575
|
nn_install_child_klasses, 1);
|
|
3555
|
-
rb_define_singleton_method(c_native_node, "create_element", nn_create_element,
|
|
3576
|
+
rb_define_singleton_method(c_native_node, "create_element", nn_create_element, -1);
|
|
3556
3577
|
rb_define_singleton_method(c_native_node, "create_text", nn_create_text, 2);
|
|
3557
3578
|
rb_define_singleton_method(c_native_node, "set_root", nn_set_root, 2);
|
|
3558
3579
|
rb_define_method(c_native_node, "create_child", nn_create_child, 1);
|
|
@@ -3578,6 +3599,11 @@ LEPTRIS_INIT_EXPORT void Init_native(void)
|
|
|
3578
3599
|
rb_define_alias(c_native_node, "name_read", "name");
|
|
3579
3600
|
rb_define_method(c_native_node, "children", nn_children, 0);
|
|
3580
3601
|
rb_define_alias(c_native_node, "children_read", "children");
|
|
3602
|
+
/* Unshadowed write face (the add_child_native pattern): the
|
|
3603
|
+
* registered Identity klasses shadow content= with the
|
|
3604
|
+
* facade; consumers plain-dispatch here for the one-frame
|
|
3605
|
+
* text write. */
|
|
3606
|
+
rb_define_alias(c_native_node, "set_text_native", "content=");
|
|
3581
3607
|
rb_define_method(c_native_node, "element_children", nn_element_children, 0);
|
|
3582
3608
|
rb_define_method(c_native_node, "next_sibling", nn_next_sibling, 0);
|
|
3583
3609
|
rb_define_method(c_native_node, "parent", nn_parent, 0);
|
data/lib/leptris/version.rb
CHANGED
data/lib/leptris/xml/native.so
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -111,8 +111,17 @@ class Leptris::XML::Document
|
|
|
111
111
|
|
|
112
112
|
# Builder factories that return NativeNodes (#149): one C call
|
|
113
113
|
# and a TypedData wrap — no FFI::Pointer, no wrap_fresh path.
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
# (context, adapter) pre-writes the consumer's contract ivars in
|
|
115
|
+
# C — the mint returns a node that already answers them, and the
|
|
116
|
+
# consumer's Ruby prime pass disappears from the build path.
|
|
117
|
+
# Older compiled exts take two args; pass through only when given.
|
|
118
|
+
def native_create_element(name, mx_context = nil, mx_adapter = nil)
|
|
119
|
+
if mx_context.nil?
|
|
120
|
+
Leptris::XML::NativeNode.create_element(self, name.to_s)
|
|
121
|
+
else
|
|
122
|
+
Leptris::XML::NativeNode.create_element(self, name.to_s,
|
|
123
|
+
mx_context, mx_adapter)
|
|
124
|
+
end
|
|
116
125
|
end
|
|
117
126
|
|
|
118
127
|
def native_create_text(content)
|