While looking through the allocator I noticed a couple issues around
sector tracking and freeing logic.
So i made this PR to fix a few issues:
Initialize the MAIN_SECTOR table so we don't read uninitialized pointers
Store newly allocated sector addresses in the sector table
Use mutable references for SectorHeader so size_left updates persist
Ensure sys::free() is only called on sector base pointers
Avoid freeing block pointers returned to the user
These changes should make sector tracking work correctly and prevent
invalid frees when blocks are deallocated.
There are still a few things that could probably be improved later
(alignment handling, page rounding, and possibly block coalescing).
If this approach looks fine I can follow up with another PR for those.
While looking through the allocator I noticed a couple issues around
sector tracking and freeing logic.
So i made this PR to fix a few issues:
- Initialize the MAIN_SECTOR table so we don't read uninitialized pointers
- Store newly allocated sector addresses in the sector table
- Use mutable references for SectorHeader so size_left updates persist
- Ensure sys::free() is only called on sector base pointers
- Avoid freeing block pointers returned to the user
These changes should make sector tracking work correctly and prevent
invalid frees when blocks are deallocated.
There are still a few things that could probably be improved later
(alignment handling, page rounding, and possibly block coalescing).
If this approach looks fine I can follow up with another PR for those.
yes, tested my network example (sending a PR for that), and other examples present in the directory(con.rs)
yes, tested my network example (sending a PR for that), and other examples present in the directory(`con.rs`)<img width="765" alt="Screenshot 2026-03-15 112626.png" src="attachments/70dd81f0-ffcd-4e0b-99d7-44370bfb849d">
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
While looking through the allocator I noticed a couple issues around
sector tracking and freeing logic.
So i made this PR to fix a few issues:
These changes should make sector tracking work correctly and prevent
invalid frees when blocks are deallocated.
There are still a few things that could probably be improved later
(alignment handling, page rounding, and possibly block coalescing).
If this approach looks fine I can follow up with another PR for those.
Did you try to compile something with this fix?
yes, tested my network example (sending a PR for that), and other examples present in the directory(
con.rs)HWA in production still doesn't work, but you did a good work. Can you change your email in the commit?
5723950f42to96865ca251sorry i missed that updated it
build: fix alloc ( #6 )to build: fix alloc (#6)