| | @@ -106,12 +106,24 @@ |
| 106 | 106 | library, the default for targets with no file of their own. |
| 107 | 107 | Examples with `printf` to `stdout`, and an X11 window, reading |
| 108 | 108 | `XEvent` as an array of words through pointer conversions. |
| 109 | + Ending a program: the entry point calls `Rt.exit(status)`, which |
| 110 | + runs the procedures registered with `Rt.atExit`, then ends it; |
| 111 | + `Rt.fail` runs them too. A buffered `lib/Out.jed`: 4 KB, flushed |
| 112 | + at each newline when standard output is a terminal, when full, |
| 113 | + by `Out.flush`, and at exit. The report says how to mix `Out` |
| 114 | + with C's `stdio`: flush one before using the other. |
| 109 | 115 | - [ ] 12. `F32`: arithmetic, conversions, calls; real literals become |
| 110 | 116 | untyped constants that take `F32` or `F64`. |
| 111 | 117 | - [ ] 13. A thread-safe `lib/Heap.jed`: its bad sizes refused, and a |
| 112 | 118 | marker in each block's header so that freeing a block twice, or |
| 113 | | - one it never gave out, stops the program. An example with |
| 114 | | - threads from `pthread_create`. |
| 119 | + one it never gave out, stops the program; `Out` locks its buffer. |
| 120 | + An example with threads from `pthread_create`. |
| 121 | + Native threads for programs without C, in |
| 122 | + `lib/Thread.linux-x86_64.jed`: `spawn` on an `mmap`ed stack with |
| 123 | + a guard page, through `clone` and a small code procedure; `join` |
| 124 | + and a `Mutex` through `futex`. `link static;` marks a module that |
| 125 | + needs a program without C; the compiler refuses a program that |
| 126 | + uses both. |
| 115 | 127 | - [ ] 14. Line numbers for gdb: `.debug_line`, with the least of |
| 116 | 128 | `.debug_info` and `.debug_abbrev` that gdb needs. |
| 117 | 129 | |