Created
January 10, 2023 15:50
-
-
Save gkaklas/d948a428acd8e86ef656821a08a4a785 to your computer and use it in GitHub Desktop.
Notes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Τι έχουμε παρατηρήσει μέχρι τώρα: | |
* Κάναμε generate LLVM bitcode για να δούμε τι παράγει σε διάφορες περιπτώσεις | |
* Το return value μιας συνάρτησης γίνεται allocate στον caller και περνάει σαν παράμετρος στον callee | |
* TODO Box example | |
* TODO Example of a value that's not used | |
* Allocators | |
* By default: `std::alloc::System` | |
* Platform specific: `malloc` on Unix-like, `HeapAlloc` on Windows | |
* We can instruct the standard library which allocator to use by placing an attribute: `#[global\_allocator]` | |
* Implement the trait `std::alloc::GlobalAlloc` | |
* `alloc()` | |
* `dealloc()` | |
* `alloc_zeroed()` | |
* `realloc()` | |
* TODO Difference with unstable `std::alloc::Allocator`? | |
* Υπάρχει υποδομή να χρησιμοποιηθούν εξωτερικοί allocators | |
* jemalloc TODO | |
* bumpalo TODO | |
* The compiler seems to already use *arena allocation* internally | |
* https://rustc-dev-guide.rust-lang.org/memory.html | |
* In general: `rustc\_arena` crate | |
* Specific implementations for some parts of the compiler? | |
* middle | |
* hir | |
* TODO Allows hash consing | |
* Each arena chunk is simply a Box | |
* Type decoding: | |
* https://rustc-dev-guide.rust-lang.org/ty.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment