Commit f2f99f2
committed
ffi/cc: compile inline C source via
cc() (bun:ffi) previously required a file path (`source`); the C REPL
wrote its accumulated buffer to a temp file on every eval. Add a
`code` option carrying inline C source text: Rust Source::String compiles
it directly with tcc_compile_string, and the JS wrapper passes it through
without path normalization. The C REPL now compiles from memory (no
/tmp/poly-c-repl-*.c), which also removes the pid-based collision window
between concurrent sessions. Entry compilation (source: file path) is
unchanged.code option, drop C REPL temp files1 parent fc0f55e commit f2f99f2
3 files changed
Lines changed: 49 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
222 | 220 | | |
| 221 | + | |
223 | 222 | | |
224 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
225 | 236 | | |
226 | | - | |
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
| |||
240 | 250 | | |
241 | 251 | | |
242 | 252 | | |
243 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
244 | 256 | | |
245 | 257 | | |
246 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2067 | 2067 | | |
2068 | 2068 | | |
2069 | 2069 | | |
2070 | | - | |
2071 | 2070 | | |
2072 | 2071 | | |
2073 | 2072 | | |
| |||
2083 | 2082 | | |
2084 | 2083 | | |
2085 | 2084 | | |
2086 | | - | |
| 2085 | + | |
2087 | 2086 | | |
2088 | 2087 | | |
2089 | 2088 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
| 280 | + | |
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
285 | 287 | | |
| 288 | + | |
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
| |||
308 | 311 | | |
309 | 312 | | |
310 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
311 | 321 | | |
312 | 322 | | |
313 | 323 | | |
| |||
1169 | 1179 | | |
1170 | 1180 | | |
1171 | 1181 | | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
1172 | 1198 | | |
1173 | 1199 | | |
1174 | 1200 | | |
| |||
0 commit comments