vein-lang / vein

🔮⚡️Vein is an open source high-level strictly-typed programming language with a standalone OS, arm and quantum computing support.
https://vein-lang.org
MIT License
47 stars 6 forks source link

GC Behaviour update and quality of life changes #225

Closed 0xF6 closed 9 months ago

0xF6 commented 9 months ago

Summary by CodeRabbit

Given the extensive nature of the provided changes, the existing bullet-point list remains valid and adequately summarizes the modifications. Therefore, it is repeated verbatim below:

coderabbitai[bot] commented 9 months ago
## Walkthrough
The changes across the system primarily involve renaming the `VM` class to `VirtualMachine` and updating associated references. Memory management has been enhanced with the introduction of `SmartPointer` for safer pointer operations and a new allocator pool for efficient memory allocation. Conditional compilation has been used to define constants for different operating systems. The test suite has been updated to reflect these changes, and new tests have been added to ensure the robustness of memory-related functionalities.

## Changes

| File(s) | Summary |
| --- | --- |
| `Directory.Build.props` | Added conditional OS-specific constants and updated `DefineConstants`. |
| `runtime/.../DefaultWatchDog.cs`, `runtime/.../ForeignFunctionInterface.cs`, `runtime/.../IshtarCore.cs`, `runtime/.../NativeExports.cs`, `runtime/.../Program.cs`, `runtime/.../AppVault.cs`, `runtime/.../ModuleReader.cs`, `runtime/.../IshtarFrames.cs`, `runtime/.../VirtualMachine.cs`, `runtime/.../vm.shit.cs`, `runtime/.../vm.switch.cs`, `test/.../IshtarTestBase.cs` | Renamed `VM` to `VirtualMachine` and updated references. |
| `runtime/.../SmartPointer.cs`, `runtime/.../CallFrame.cs`, `runtime/.../stackval.cs` | Introduced `SmartPointer` struct for memory management and updated usage. |
| `runtime/.../IshtarGC.cs`, `runtime/.../IshtarObject.cs`, `runtime/.../RuntimeIshtarClass.cs`, `runtime/.../RuntimeIshtarField.cs`, `runtime/.../allocators/IIshtarAllocatorPool.cs` | Enhanced memory management with new data structures, allocator pool, and debug info. |
| `test/.../ArrayTest.cs`, `test/.../GCTest.cs`, `test/.../InstructionSizeTest.cs`, `test/.../InstructionTest.cs`, `test/.../MethodExecuteTest.cs` | Updated tests to use array indexing for `returnValue` and added new memory management tests. |
| `runtime/.../IshtarArray.cs`, `runtime/.../__builtin/B_StringBuilder.cs`, `runtime/.../runtime/IshtarGC.cs` | Modified memory allocation methods and assertions. |
| `runtime/.../FFI/GCFlags.cs`, `runtime/common/reflection/VeinTypeCode.cs` | Added new enum values and specified underlying type for `VeinTypeCode`. |
| `runtime/.../ishtar.vm.csproj`, `test/.../ishtar_test.csproj` | Updated project files for build configurations. |
| `test/.../NegativeCases.cs` | Modified test to handle unsafe pointer operations and exception assertions. |

> 🐇 In the fall, where leaves descend,  
> Our code now safer, bugs to mend.  
> With `SmartPointer` and `VirtualMachine`,  
> Memory dances, clean and pristine. 🍂🧹

Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`
0xF6 commented 9 months ago

@coderabbitai review