src/db.c: WIP: integrate SQLite3 with talloc allocator

The current version of this commit enables a custom memory
allocator for SQLite3 via SQLITE_CONFIG_MALLOC. If OsmoHLR is
compiled with ENABLE_TALLOC macro, talloc is used. Otherwise
the default malloc/realloc/free are used.

There are lots of debug messages for each call. They are helpful
for comparison heap usage footprints between both talloc & malloc.

NOTE: SQLite3 version 3.8.2 fails (at least) to init the database
with talloc, and there is some big difference in heap usage
footprint compared to malloc. At the same time, with the recent
SQLite3 version 3.24.0, both heap usage footprints are identical,
and OsmoHLR works fine...

Change-Id: Icfe67ed0f063b63e6794f9516da3003d01cf20a7
1 file changed