Commit 1900682
authored
chore: fix some small things (#3)
addressing some feedback from @kopecs
> * https://github.com/semgrep/pyro-caml/blob/5937a13eee7b5f2313ed5d7d11a3d7726a35970f/src/main.rs#L127
Safety comment
But also, do we need this for a subprocess or something? Does https://docs.rs/pretty_env_logger/latest/pretty_env_logger/fn.formatted_timed_builder.html and filter_level or whatever work?
> * https://github.com/semgrep/pyro-caml/blob/5937a13eee7b5f2313ed5d7d11a3d7726a35970f/src/ocaml_intf.rs#L28
Safety comment (same for others in this file)
Stupid why is this unsafe and the docs for the library have no details. I mean, I get it, FFI, but still.
> * https://github.com/semgrep/pyro-caml/blob/5937a13eee7b5f2313ed5d7d11a3d7726a35970f/src/backend.rs#L21-L25
OK, I might not understand this, but what does the runtime actually do here? I think I am missing what the actual interaction is. We have our own thread local runtime to call an ffi function?
> * https://github.com/semgrep/pyro-caml/blob/5937a13eee7b5f2313ed5d7d11a3d7726a35970f/src/backend.rs#L99
seems not so useful to log that this was just called?
As far as the runtime point goes, we can't send runtimes across threads, so this was the easiest way for me to get one where it needs to be. I probably could be more clever about where/when I create it but 🤷3 files changed
+20
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
101 | 112 | | |
102 | 113 | | |
103 | 114 | | |
104 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
105 | 122 | | |
106 | 123 | | |
107 | 124 | | |
0 commit comments