Skip to content

Conversation

@kammce
Copy link
Member

@kammce kammce commented Dec 23, 2025

This commit refactors the async::context memory management system to use a scheduler-provided allocator instead of requiring pre-allocated stack memory. The scheduler interface now includes a get_allocator() method that returns a polymorphic memory resource, and context objects now automatically allocate and deallocate their stack memory using this allocator.

Changes:

  • Add get_allocator() virtual method to scheduler interface
  • Update context constructor to accept stack size instead of strong_ptr to pre-allocated memory
  • Implement automatic stack allocation/deallocation in context using polymorphic allocator
  • Update strong_ptr dependency from 0.0.2 to 0.1.2
  • Add stricter compiler flags (-Werror, -Wall, -Wextra, -Wshadow, -fexceptions, -fno-rtti)
  • Update tests to implement new allocator interface

Resolves #18

@kammce kammce changed the title Add scheduler allocator interface and automated stack memory management Add scheduler allocator interface Dec 23, 2025
@kammce kammce force-pushed the scheduler-allocator branch from fafabb7 to 24f992a Compare December 23, 2025 21:48
This commit refactors the async::context memory management system to use
a scheduler-provided allocator instead of requiring pre-allocated stack
memory. The scheduler interface now includes a get_allocator() method
that returns a polymorphic memory resource, and context objects now
automatically allocate and deallocate their stack memory using this
allocator.

Changes:

- Add get_allocator() virtual method to scheduler interface
- Update context constructor to accept stack size instead of strong_ptr
  to pre-allocated memory
- Implement automatic stack allocation/deallocation in context using
  polymorphic allocator
- Update strong_ptr dependency from 0.0.2 to 0.1.2
- Add stricter compiler flags (-Werror, -Wall, -Wextra, -Wshadow,
  -fexceptions, -fno-rtti)
- Update tests to implement new allocator interface
@kammce kammce force-pushed the scheduler-allocator branch from 24f992a to 318a126 Compare December 23, 2025 21:57
@kammce kammce merged commit 8b09c85 into main Dec 23, 2025
5 checks passed
@kammce kammce deleted the scheduler-allocator branch December 23, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Choose a better type/strategy for "stack memory"

2 participants