In this section you will find pieces of code that can help you to handle data structures:
This simple object pre-allocates a stack of C structures (or C++ objects).
Then you can replace the memmory management (malloc / delete) by a stack management.
The advantages of using a stack instead of a memory are:
- Robustness: The memory is allocated at the service start, so there is no problem of memory allocation after the service initialization.
- Performance: An allocation/restitution from a stack is far more efficient than a memory malloc/delete
Github repository: QbPreAllocStack
QbCircBuffer
This code implements a circular buffer.
This circular buffer can be used as a buffer memory storage between several writing threads (providers) and a single reading thread (consummer).
The typical use case is a buffer that collects data before processing them in a unique stream (writing on disk, sending on network socket, processing by a compression algorithm, etc.)
Github repository: QbCircBuffer
QbGifBuilder provides an API to generate animated GIF in different languages for different OS.
Available languages:
- C#
- C++ (alone or with other framework like Qt)
Github repository: QbGifBuilder
Language: C/C++
QbPreAllocStackThis simple object pre-allocates a stack of C structures (or C++ objects).
Then you can replace the memmory management (malloc / delete) by a stack management.
The advantages of using a stack instead of a memory are:
- Robustness: The memory is allocated at the service start, so there is no problem of memory allocation after the service initialization.
- Performance: An allocation/restitution from a stack is far more efficient than a memory malloc/delete
Github repository: QbPreAllocStack
QbCircBuffer
This code implements a circular buffer.
This circular buffer can be used as a buffer memory storage between several writing threads (providers) and a single reading thread (consummer).
The typical use case is a buffer that collects data before processing them in a unique stream (writing on disk, sending on network socket, processing by a compression algorithm, etc.)
Github repository: QbCircBuffer
Multi-language projects
QbGifBuilderQbGifBuilder provides an API to generate animated GIF in different languages for different OS.
Available languages:
- C#
- C++ (alone or with other framework like Qt)
Github repository: QbGifBuilder