> On Feb 15, 2018, at 10:09 AM, Simon Slavin <slav...@bigfraud.org> wrote:
> 
> 1) I can't be the only programmer who learned to make paired calls ("If you 
> initialise something, it needs deinitializing, if you allocate something, 
> deallocate it.").

When a process exits, its resources are automatically cleaned up by the kernel 
— memory and address space freed, file handles and sockets closed, etc. So it’s 
generally unnecessary to do redundant cleanup like sqlite3_shutdown* on quit, 
and it can actually slow things down**, especially if freeing a zillion heap 
blocks that have been paged out or are no longer in CPU caches.

—Jens

* This doesn’t apply to sqlite3_close() on a writeable database, since SQLite 
may need to update data in the file before closing it.
**  Case in point: One of the optimizations added to MacOS about five years ago 
was ‘fast termination’, wherein quitting an app will terminate it instantly 
with a simple call to exit(0) if the app code doesn’t have any special cleanup 
it needs to do.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to