|
| 1 | +I accept small patches, but because this is my hobby project to |
| 2 | +learn about compilers, it's unlikely to accept large patches. |
| 3 | +That's in practice not going to be an issue, because |
| 4 | +if you are writing a large patch, that is your hobby project. |
| 5 | +You want to hack in your forked repository rather than |
| 6 | +taking time to send pull requests. |
| 7 | + |
| 8 | +# Memory management |
| 9 | + |
| 10 | +No memory management is a memory management scheme in 8cc. |
| 11 | +Memory regions allocated using malloc are never freed |
| 12 | +until the process terminates. That has greatly simplified |
| 13 | +the code and the APIs because 1) you can write code as if |
| 14 | +garbage collector were present, and 2) that design |
| 15 | +decision has eliminated use-after-free bugs entirely. |
| 16 | + |
| 17 | +Modern computers have gigs of memory. 8cc consumes |
| 18 | +only about 100MB to compile 10K lines of C source file. |
| 19 | +Compiler is not a long-running process. |
| 20 | +It will never run out of memory unless you give an |
| 21 | +unrealistically large source file. |
| 22 | + |
| 23 | +If we really need to free memory, we could use Boehm garbage |
| 24 | +collector. I don't see that need at this moment though. |
| 25 | + |
| 26 | +# Backend |
| 27 | + |
| 28 | +Backend is being rewritten. Once it's done, the current backend |
| 29 | +code will be discarded. The new backend models after the LLVM IR |
| 30 | +because the IR looks to be designed well. That's not going to be |
| 31 | +the same, though. |
0 commit comments