-
Notifications
You must be signed in to change notification settings - Fork 50
feat: 更新内存分配器的介绍 #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 更新内存分配器的介绍 #241
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates documentation for memory allocators and variable definitions in the course materials. Key changes include:
- Adding a Zig code example for using C header imports in variable definition documentation.
- Revising the list and descriptions of memory allocators, replacing GeneralPurposeAllocator with DebugAllocator and adding SmpAllocator.
- Removing outdated sections for HeapAllocator and updating reference links accordingly.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| course/basic/define-variable.md | Added a Zig code snippet demonstrating c header inclusion and usage. |
| course/advanced/memory_manage.md | Updated the enumerated list and descriptions of memory allocators for clarity. |
Files not reviewed (1)
- course/code/14/memory_manager.zig: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates documentation for memory allocators and variable definitions in Zig.
- Updates examples on how to import C headers via cImport in the basic course documentation.
- Revises the memory allocator section by replacing GeneralPurposeAllocator with DebugAllocator, and adds a new SmpAllocator section with design details.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| course/basic/define-variable.md | Adds an example demonstrating cImport usage with xcb header includes. |
| course/advanced/memory_manage.md | Updates allocator listings and descriptions, introducing DebugAllocator and SmpAllocator. |
Files not reviewed (1)
- course/code/14/memory_manager.zig: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
The PR updates documentation for memory allocators by adding a new example for using Zig's C import mechanism and revising the memory allocator sections with new DebugAllocator and SmpAllocator entries.
- Added a Zig code snippet in define-variable.md to illustrate cImport usage.
- Reordered and renamed memory allocator sections in memory_manage.md to include DebugAllocator and SmpAllocator.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| course/basic/define-variable.md | Added example usage of cImport for including C header files. |
| course/advanced/memory_manage.md | Updated memory allocator list and sections to reflect new allocators. |
Files not reviewed (1)
- course/code/14/memory_manager.zig: Language not supported
Comments suppressed due to low confidence (2)
course/advanced/memory_manage.md:41
- Ensure that the header 'DebugAllocator' and its description accurately reflect the intended usage and behavior of the allocator, especially since the previous section was 'GeneralPurposeAllocator'. If this change is intentional, confirm that all associated references and details have been updated consistently.
## `DebugAllocator`
course/advanced/memory_manage.md:138
- Verify that the reference to 'DebugAllocator' is intended to replace all instances of 'GeneralPurposeAllocator' throughout the document. This ensures the naming and documentation are consistent with the new allocator implementation.
查看 [`std/heap.zig`](https://github.com/ziglang/zig/blob/master/lib/std/heap.zig) 和 [`std.heap.DebugAllocator`](https://github.com/ziglang/zig/blob/master/lib/std/heap/debug_allocator.zig)
No description provided.