summaryrefslogtreecommitdiff
path: root/src/libdeno.rs
AgeCommit message (Collapse)Author
2019-01-15 Add --prefetch flag for deps prefetch without running (#1475)Kevin (Kun) "Kassimo" Qian
2019-01-03Add rust binding and test for deno_execute_mod()Ryan Dahl
2019-01-03Use camel-case for libdeno::deno_recv_cbRyan Dahl
For better greppability and conformance with other symbols in libdeno.rs
2019-01-02Happy new year!Ryan Dahl
2018-12-13Merge deno_new_snapshotter behavior into deno_new (#1318)Ryan Dahl
2018-12-05Isolate::from_raw_ptr and other cleanups.F001
`Isolate::from_void_ptr` is renamed to `from_raw_ptr`, to keep consistency with std libs. It is changed to `unsafe` function, because it can't guarantee that the input is valid. This guarantee should be provided by the caller. Its return type is changed to `&Isolate`, because `&mut Isolate` type requires that no other aliases co-exist in this period of time, this does not seem true. So I changed most of the methods to accept shared reference `&Isolate`. It is easier to reason about the correctness of `unsafe` blocks. As long as these shared references are in the same thread, these `unsafe` codes are probably correct.
2018-12-04Add deno_config struct for isolate creation. (#1277)Ryan Dahl
In preperation for adding other callbacks to libdeno.
2018-12-04Remove static lifetime bound in OpCreator (#1276)F001
The main purpose of this PR is to remove the `'static` lifetime bound in type OpCreator = fn(state: &Arc<IsolateState>, base: &msg::Base, data: &'static mut [u8]) -> Box<Op>; The reason is simple: it is plain wrong, the `data` is actually not `'static`. It is created when the message is sent from C side, and will be recycled when the message is responded. It violates the definition of `'static` lifetime. If someone save this pointer somewhere else, and reuse it later again, uninitialized memory could be accessed. This kind of memory unsafety does not happen yet because the logic is carefully organized in this project. Lifetime constraints are maintained by code convention. It could be more robust if we can express this constraint by Rust's type system. Basic idea: tie buffer's lifetime to an object's lifetime, a.k.a, RAII. The type `deno_buf` is pretty suitable for this job.
2018-12-03Avoid memory leak (#1265)F001
2018-11-30clippy fixes (#1250)Andy Hayden
2018-11-29Replace mutex by atomics (#1238)F001
2018-10-24Add libdeno.shared global shared ArrayBuffer.Ryan Dahl
2018-10-24libdeno: deno_new should take a snapshot parameter.Ryan Dahl
2018-10-12Fix promise reject issue (#936)Kevin (Kun) "Kassimo" Qian
2018-10-08Remove deno_get_data()Bert Belder
Instead, pass the isolate data to the dispatch callback directly.
2018-10-08Abide by the rules when passing Isolate between c and rustBert Belder
Ensure that at most one mutable Isolate reference exists at a time. `deno_execute()` and `deno_respond()` now borrow a reference to the rust-side isolate from the caller. When we need a reference to the isolate while one of these functions is on the stack, `deno_get_data()` can be used to borrow back that reference.
2018-10-08Rename Deno.data to Deno.user_dataBert Belder
Also use the correct rust type for it.
2018-09-27Support zero-copy data in libdeno.send(). (#838)Ryan Dahl
This is a large API refactor of deno.h which replaces deno_send() and deno_set_response() with deno_respond(). It also adds a req_id parameter to the deno_recv_cb. Make writeFile/writeFileSync use it.
2018-09-22Rename deno.argv, libdeno::DenoC and deno_set_flags (#796)ztplz
2018-09-05Rename src/binding.rs -> src/libdeno.rsRyan Dahl