dyna3/app-proto
Vectornaut e917272c60 Give each element a serial number (#22)
Give each `Element` a serial number, which identifies it uniquely. The serial number is assigned by the `Element::new` constructor.

Because disallows potentially unsafe global state (at least without explicit `unsafe` blocks), the next serial number is stored in a thread-safe static atomic variable (`assembly::NEXT_ELEMENT_SERIAL`), as suggested in [this StackOverflow answer](https://stackoverflow.com/a/32936288). Since the overhead for keeping track of memory ordering should be minimal, we're using the strongest available ordering: [sequentially consistent](https://marabos.nl/atomics/memory-ordering.html#seqcst).

Resolves #20.

Co-authored-by: Aaron Fenyes <aaron.fenyes@fareycircles.ooo>
Reviewed-on: #22
Co-authored-by: Vectornaut <vectornaut@nobody@nowhere.net>
Co-committed-by: Vectornaut <vectornaut@nobody@nowhere.net>
2024-11-22 02:25:10 +00:00
..
src Give each element a serial number (#22) 2024-11-22 02:25:10 +00:00
.gitignore feat: Application prototype (#14) 2024-10-21 23:38:27 +00:00
Cargo.toml Clean up the outline view (#19) 2024-11-15 03:32:47 +00:00
index.html Clean up the outline view (#19) 2024-11-15 03:32:47 +00:00
main.css Clean up the outline view (#19) 2024-11-15 03:32:47 +00:00
run-examples Integrate engine into application prototype (#15) 2024-11-12 00:46:16 +00:00