symisc / unqlite

An Embedded NoSQL, Transactional Database Engine
https://unqlite.symisc.net
Other
2.11k stars 164 forks source link

Unqlite footprint & usage on MCU without MMU #83

Closed Citrullin closed 5 years ago

Citrullin commented 5 years ago

I am looking for a database for my embedded devices. Especially for the Cortex-M series. The issue here is just that the M series doesn't have a MMU. So it doesn't make sense to use malloc there due to fragmented memory issues. I took a short look into the code and I found a few places with malloc. Does this database targets these kind of devices? If not, is there a good alternative you can think about? Are they any information about the footprint published?

symisc commented 5 years ago

Well, UnQLite support plugged-in memory allocators. You can install your own allocator wrapped on your OS primitives. This can be done via unqlite_lib_config() using the config verb: UNQLITE_LIB_CONFIG_USER_MALLOC. Documentation on how to do this is located at https://unqlite.org/c_api_object.html#SyMemMethods.