On 04/12/2017 20:59, Keith Medcalf wrote:

You should only be defining SQLITE_CORE if in fact the extension is part of the 
core -- that is compiled and included (statically linked) to the core sqlite3.c 
compilation unit.  In this case, the extension makes direct calls to the 
sqlite3 entry points and shares the same runtime as the sqlite3 core engine.

If the extension is *not* part of the same linkage unit as sqlite3.c, then it 
cannot access the sqlite3 core functions using direct linkage and must instead 
use a structure of function pointers (aka a class) for indirect access.

Having an extension be a part of the core but not telling it so is only 
deleterious to performance (linkage is via indirect function pointers rather 
than static linkage).

Telling an extension that it is part of the core when it is not will lead to 
memory access errors, either due to bad loadtime linkage or more likely to the 
fact that it is using a separate runtime heap and/or stack manager and neither 
the extension nor the actual sqlite3 core can manage each others' memory 
allocations.
Got it. I had misinterpreted the documentation in a way that—
now I realize—doesn't make much sense.

Thanks for the clear explanation!
Life.

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to