What is the best way for kernel modules to allocate/free memory. I thought of two possibilties:
1. Have an ISR to do it, maybe latch the allocator and freer-upper (cool word) onto different interrupts. Only worry with this is speed. Context switching won't be an issue for kernel modules but maybe user code will be affected.
2. When loading executables bind them to the alloc/free functions directly. This will be fast but does kind of make things a lot more monolithic.
Any other suggestions?
Alloc/Free API Calls
- Pype.Clicker
- Member

- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Alloc/Free API Calls
Clicker has a generic 'kalloc' service that module links to at load-time. This service is just a kind of "rendez-vous point" where memory providers can register and offer allocation with some property bits (for instance KMEM_DRIVER offers DMA-aware memory ...) for a given memory range.