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

Add Allocator API #22

Open
1 task
vortexofdoom opened this issue Nov 20, 2024 · 0 comments
Open
1 task

Add Allocator API #22

vortexofdoom opened this issue Nov 20, 2024 · 0 comments
Labels
enhancement Small enhancement to existing feature feature New feature

Comments

@vortexofdoom
Copy link
Collaborator

vortexofdoom commented Nov 20, 2024

An allocator that can keep track of the available memory in a given region would be very useful, particularly for relatively small and potentially sparsely populated regions such as oam. This would ideally include:

  • General purpose allocator for wram
  • Generic allocator specialized to individual regions optimized for particular types (object attributes, tile data, etc.)
  • An overarching allocator wrapping all of these for all library types, potentially using the std.Allocator interface.

If a general-purpose allocator is too bloated or slow, we should at least expose an API by which users can insert their own allocation strategies optimized for their use case.

Planned features (open to discussion):

  • Create and manage fixed-size pools of memory with different replacement/update strategies. It's rare to want to manage all object types the same way: sometimes you want an instantiation to replace an existing item, and sometimes you want it to just fail silently. LRU, LFU, and other Eviction strategies would be good to include at the library level.
@vortexofdoom vortexofdoom changed the title Add Allocator api Add Allocator API Nov 20, 2024
@vortexofdoom vortexofdoom added enhancement Small enhancement to existing feature feature New feature labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Small enhancement to existing feature feature New feature
Projects
None yet
Development

No branches or pull requests

1 participant