Category: rustlang
-
3 Statements and Expressions in Rust
3 Statements and Expressions in Rust The same variable name can be defined multiple times The inner scope defines a new variable x that shadows the outer x. As a result, the value of x defined within the inner scope does not affect the value of the x in the outer scope The result of…
-
2 Union vs. Enum in Rust: Understanding Memory Layout
2 Union vs. Enum in Rust: Understanding Memory Layout mem::size_of::<MyUnion>() -> 8 bytes The size is based on the largest member. mem::size_of::<MyUnion>() -> 24 bytes The size of determined by the size of the largest vaiant plus the size of the additional identifier(tag) and then aligned to the required memory alignment. The size of the…
-
1 How to set up a JIT debugger to inspect the runtime memory of Rust code?
How to set up a JIT debugger to inspect the runtime memory of Rust code? TOC 1 Enable a Just-In-Time debugger 2. Enable a JIT debugger form the windows registry 3. Insert an int3 assembly instruction 4. Running the compiled executale application 5. The process from triggering an exception 6. The Key Terminology Breakdown 2.…