Adjustable Buffers, Number and Sizes
Posted: Fri May 10, 2019 11:43 am
I have several library modules that are basically application-independent, apart from the number of buffers and the buffer sizes. Arrays are easy and well performing data structures for buffers, but they are of a fixed size. For maintenance reasons, I would prefer to configure these library modules on a per-program basis, ie. not duplicate them per application with the number of buffers and their sizes adjusted accordingly.
I see two possibilities. 1) I can use using dynamic data structures using linked lists, which can be configured at start-up with an Init() call. But linked lists for an array-like fixed size buffer seems an overkill. 2) Or I extract the configuration constants into a configuration module, with a default config module right there with the library module, and the possibility to create an application-specific one in the folder of the main module.
Is there a third solution that I don't see?
I see two possibilities. 1) I can use using dynamic data structures using linked lists, which can be configured at start-up with an Init() call. But linked lists for an array-like fixed size buffer seems an overkill. 2) Or I extract the configuration constants into a configuration module, with a default config module right there with the library module, and the possibility to create an application-specific one in the folder of the main module.
Is there a third solution that I don't see?