On 12/24/15, Bart Smissaert <bart.smissaert at gmail.com> wrote:
> My question is if there is ever any need in this situation to run one of
> the sqlite3 memory procedures, that is
> sqlite3_free, sqlite3_malloc or sqlite3_realloc?
> Currently I am not using this anywhere in my VB6 code.
> Should I?

Cases when you might use sqlite3_malloc():

(1) You are using on of SQLite's built-in memory allocators.  The
built-in memory allocators are disabled unless you use certain
compile-time options.  And even then, you have to turn them on using
sqlite3_config(SQLITE_CONFIG_HEAP,...).

(2) You need to use sqlite3_msize().

(3) If you use sqlite3_mprintf(), then sqlite3_free() must be used to
release the string once you are done with it.

Otherwise, there is no real advantage to using SQLite memory allocator
interface in place of your standards system memory allocator.

-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to