lichen-community-systems / signaletic

A music signal processing library designed for embedded environments and Web Assembly, in C
MIT License
7 stars 2 forks source link

Signaletic's memory allocator should be refactored so that alternative implementations can be provided #44

Closed colinbdclark closed 2 years ago

colinbdclark commented 2 years ago

I anticipate that users in some situations may want to provide their own memory allocator implementation to integrate Signaletic more closely with an existing system. It should be easier to do so. I can think of two potential approaches to this:

  1. Refactor star_Allocator so that it provides function pointers for malloc, free, etc. The implementer of an alternative Allocator would only need to provide a struct type that includes pointers to their custom implementation.
  2. Separate the allocator out into its own standalone implementation file so that it is easier to provide a separate implementation by replacing the source file with a custom implementation that corresponds to the header.