You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace interrupt masking with spinlock in malloc for SMP support
The original malloc/free implementation used CRITICAL_ENTER() and
CRITICAL_LEAVE() to protect critical sections by simply disabling
interrupts, which is sufficient on single-core systems.
To support SMP, we replace these with a proper spinlock that uses RV32A
atomic instructions. This ensures correctness when multiple harts
access the allocator concurrently.
This change allows future task scheduling across multiple harts without
risking race conditions in the memory allocator.
0 commit comments