Skip to content

Commit 76fb390

Browse files
committed
upgrade edn; no memory holding does not work
1 parent 2ce5772 commit 76fb390

File tree

6 files changed

+15
-43
lines changed

6 files changed

+15
-43
lines changed

.github/workflows/check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
- uses: calcit-lang/[email protected]
1818
with:
19-
version: "0.8.51-a4"
19+
version: "0.8.51-a6"
2020

2121
- uses: dtolnay/rust-toolchain@stable
2222
with:

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ crate-type = ["dylib"] # Creates dynamic lib
1313
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1414

1515
[dependencies]
16-
# cirru_edn = "0.6.4-a4"
17-
cirru_edn = { path = "/Users/chenyong/repo/cirru/edn.rs" }
16+
cirru_edn = "0.6.4-a5"
17+
# cirru_edn = { path = "/Users/chenyong/repo/cirru/edn.rs" }
1818
cirru_parser = "0.1.29"
1919
regex = "1.10.4"
2020
lazy_static = "1.4.0"

calcit.cirru

Lines changed: 7 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compact.cirru

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
:files $ {}
77
|regex.core $ %{} :FileEntry
88
:defs $ {}
9-
|hold-patterns-memory! $ %{} :CodeEntry (:doc |)
10-
:code $ quote
11-
defn hold-patterns-memory! ()
12-
&call-dylib-edn (get-dylib-path "\"/dylibs/libcalcit_regex") "\"holding_patterns_memory"
13-
println "\"memory of regex patterns are set to hold!"
149
|re-drop $ %{} :CodeEntry (:doc |)
1510
:code $ quote
1611
defn re-drop (pattern)
@@ -66,7 +61,6 @@
6661
assert= |1abXcX3 $ re-replace-all |1ab22c333 |\d{2} "\"X"
6762
assert= ([] "\"1ab" "\"c" "\"3") (re-split |1ab22c333 |\d{2})
6863
println "\"%%% test variable holding regex"
69-
hold-patterns-memory!
7064
let
7165
pattern $ re-pattern "\"\\d+"
7266
p2 $ re-pattern "\"\\w+"
@@ -79,10 +73,11 @@
7973
assert= |XabXcX $ re-replace-all |1ab22c333 pattern "\"X"
8074
w-log $ re-drop p2
8175
w-log $ re-drop pattern
76+
w-log $ re-drop pattern
8277
:ns $ %{} :CodeEntry (:doc |)
8378
:code $ quote
8479
ns regex.test $ :require
85-
regex.core :refer $ re-matches re-find-index re-find re-find-all re-split re-replace-all re-pattern re-drop hold-patterns-memory!
80+
regex.core :refer $ re-matches re-find-index re-find re-find-all re-split re-replace-all re-pattern re-drop
8681
regex.$meta :refer $ calcit-dirname calcit-filename
8782
|regex.util $ %{} :FileEntry
8883
:defs $ {}

src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ pub fn abi_version() -> String {
1616
String::from("0.0.8")
1717
}
1818

19-
/// just call mem::forget to avoid GC
20-
#[no_mangle]
21-
pub fn holding_patterns_memory() -> Result<Edn, String> {
22-
let patterns = PATTERNS.lock().unwrap();
23-
let data = patterns.to_owned();
24-
std::mem::forget(data);
25-
Ok(Edn::Nil)
26-
}
27-
2819
#[no_mangle]
2920
pub fn re_pattern(args: Vec<Edn>) -> Result<Edn, String> {
3021
if args.len() == 1 {

0 commit comments

Comments
 (0)