Skip to content
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

Implement simple linear allocator #57

Merged
merged 15 commits into from
Nov 3, 2023
Merged

Implement simple linear allocator #57

merged 15 commits into from
Nov 3, 2023

Conversation

c71n93
Copy link
Member

@c71n93 c71n93 commented Nov 2, 2023

Closes #50

This PR adds:

  • LinearBuffer - buffer for linear allocator
  • IAllocator - interface for all allocators (such allocators can be used in standard containers)
  • LinearAllocator - simple linear allocator (this allocator uses LinearBuffer, which is stored as a reference-field)

@c71n93 c71n93 requested a review from levBagryansky November 2, 2023 14:43
Copy link
Member

@levBagryansky levBagryansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c71n93 looks really cool! a few comments from my side

include/ChaiVM/memory/linear-allocator.hpp Show resolved Hide resolved
include/ChaiVM/memory/linear-buffer.hpp Outdated Show resolved Hide resolved
src/ChaiVM/memory/linear-buffer.cpp Show resolved Hide resolved
test/ChaiVM/memory/linear-allocator-test.cpp Show resolved Hide resolved
@c71n93 c71n93 merged commit 5f57234 into master Nov 3, 2023
5 checks passed
@c71n93 c71n93 deleted the 50-arena-allocator branch November 3, 2023 12:21
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.

Add custom allocator (arena allocator)
2 participants