Commit graph

403 commits

Author SHA1 Message Date
Sebastian Ullrich
a1c17ade3a fix: use-after-free in keep-alive tasks 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
ac56a9e79f fix: run tasks to completion on task_manager shutdown to prevent leaks 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
fc4428f621 fix: mark Task closures as MT 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
a93a53b4b5 feat: more IO Task functions 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
469a822cc6 chore: checkInterrupted ~> checkCanceled, requestInterrupt ~> cancel 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
77cbaa752c fix: Task: make reference and -j0 semantics eager, simplify 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
5b83ceb1b5 feat: IO.mapTask, IO.bindTask 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
307a833798 feat: implement IO.asTask as primitive using always-run tasks 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
1782352af1 feat: optionally run tasks even when already cancelled 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
4bce9eb9a5 doc: document lean_st_ref_get peculiarity 2020-08-31 15:55:21 +02:00
Sebastian Ullrich
c88784ef9d refactor: consistent io_result_mk* naming
/cc @leodemoura
2020-08-31 11:08:57 +02:00
Sebastian Ullrich
1fb1a6f913 fix: do not expose invalid process handles when not redirected 2020-08-30 14:28:56 -07:00
Sebastian Ullrich
cc909e20e1 fix: handle SIGPIPE 2020-08-30 14:28:56 -07:00
Sebastian Ullrich
9f40e46043 feat: basic process API 2020-08-30 14:28:56 -07:00
Sebastian Ullrich
00f176de8d fix: Windows debug build 2020-08-30 14:28:56 -07:00
Sebastian Ullrich
110ae4b571 feat: replace OS-specific stream redirection with pure-Lean Stream redirection
This avoids the temporary files workaround on macOS and Windows, and makes sure
we can process a `#eval` command and write messages to stdout at the same time.
2020-08-28 10:04:32 -07:00
Sebastian Ullrich
efa119bc94 feat: make std streams Streams 2020-08-28 10:04:32 -07:00
Sebastian Ullrich
56fda835be feat: add ByteArray <-> String conversions 2020-08-28 10:04:32 -07:00
Sebastian Ullrich
dbebff3a2d feat: ByteArray.copySlice 2020-08-28 10:04:32 -07:00
Sebastian Ullrich
1b0ffbb74d feat: make std IO streams settable
Co-authored-by: Simon Hudon <simon.hudon@gmail.com>
2020-08-28 10:04:32 -07:00
Leonardo de Moura
6180ba6d7d chore: rename ST.Ref primitives 2020-08-23 12:28:14 -07:00
Leonardo de Moura
c0dbf60830 feat: remove IO.ref.reset
`reset` was used to implement a "buggy" `IO.ref.modify`.
```lean
@[inline] def Ref.modify {α : Type} (r : Ref α) (f : α → α) : m Unit := do
v ← r.get;
r.reset;
r.set (f v)
```
`IO.Ref.reset` will store a nullptr in `r`.
Now, suppose another thread tries to read this reference,
it will get an `IO.error`.
It is not a crash, but it is really weird behavior.
2020-08-20 10:07:15 -07:00
Leonardo de Moura
e3b1ae514b fix: nontermination
This issue was reported by Simon Winwood at Zulip.
Here is the message

The following code doesn't terminate (in a reasonable amount of time)
```
def large_nat : Nat := (9223372036854775807 : Nat)
```
$ time lean --o=large-nat.olean large-nat.lean
2020-08-18 18:45:28 -07:00
Sebastian Ullrich
edeed7b849 chore: fix C++ warnings 2020-08-14 14:42:44 +02:00
Wojciech Nawrocki
55655869b7 feat: default to binary file mode on Windows 2020-08-13 09:21:35 -07:00
Sebastian Ullrich
c38f4fe837 feat: unsafe functions for freeing compacted regions 2020-07-10 07:42:26 -07:00
Sebastian Ullrich
6404af6983 feat: IO.Prim.withIsolatedStreams 2020-06-16 10:41:42 -07:00
Sebastian Ullrich
f4c28fbe5f chore: remove unnecessary getByte/putByte IO primitives 2020-06-16 12:06:53 +02:00
Simon Hudon
a64e78b90b feat: add std streams
Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2020-06-16 12:06:53 +02:00
Leonardo de Moura
2f1ec93289 chore: move runtime implementation to src/runtime 2020-05-22 14:35:16 -07:00
Leonardo de Moura
1a77ee4f89 chore: delete old runtime directory 2020-05-18 11:33:18 -07:00
Leonardo de Moura
8bdca35282 chore: use #include <lean/runtime/...> for runtime .h files 2020-05-18 11:30:07 -07:00
Sebastian Ullrich
9fdcf6ea59 refactor: put all includes in include/lean/ 2020-05-18 11:00:26 -07:00
Sebastian Ullrich
10253e89ea chore: move bin/ and .oleans into build directory 2020-05-14 14:47:54 +02:00
Sebastian Ullrich
5d260c396f fix: macOS build 2020-05-14 14:47:54 +02:00
Sebastian Ullrich
be79820a47 feat: add IO.currentDir 2020-05-14 14:38:52 +02:00
Sebastian Ullrich
5107403d24 feat: detect stack overflows on all platforms and threads 2020-05-04 11:11:11 +02:00
Sebastian Ullrich
7899ab3761 feat: report stack overflows as such on Linux
Port of the corresponding Rust code (Apache/MIT)
2020-04-30 13:16:42 -07:00
Leonardo de Moura
e22af8d1ef feat: add FloatArray
cc @dselsam
2020-04-07 18:05:54 -07:00
Leonardo de Moura
8e84a8c9ec feat: Float from big numbers 2020-04-06 14:05:17 -07:00
Leonardo de Moura
acad6015c4 chore: add new primitives to object.h 2020-04-03 18:26:13 -07:00
Leonardo de Moura
64c3be44f8 fix: lean_unbox_float 2020-04-03 18:23:45 -07:00
Leonardo de Moura
8e952f3c36 chore: style 2020-04-03 17:48:06 -07:00
Leonardo de Moura
c236a179f2 feat: enable externs 2020-04-03 17:19:48 -07:00
Leonardo de Moura
71397aad36 feat: runtime primitives 2020-04-03 15:55:39 -07:00
Leonardo de Moura
098b0edbcb chore: remove dead code 2020-03-23 15:56:29 -07:00
Leonardo de Moura
2cc0f25bf5 feat: getLine at EOF should return empty string
This is the same approach used in Rust, and it simplifies the code.
2020-03-23 15:44:47 -07:00
Leonardo de Moura
b2bddb5606 chore: style 2020-03-23 14:06:02 -07:00
Leonardo de Moura
db914052ce fix: IO.getLine 2020-03-23 12:26:09 -07:00
Leonardo de Moura
1dc9f9a7d8 chore: remove old names 2020-02-28 10:53:42 -08:00