mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-18 20:22:13 +03:00
Continuing work on adding full support for the SQLITE_OMIT_WSD
compile-time option. (CVS 5658) FossilOrigin-Name: ef26ea5c46d3915d206f8ff7f82a24f4c8955f1f
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
*************************************************************************
|
||||
** Internal interface definitions for SQLite.
|
||||
**
|
||||
** @(#) $Id: sqliteInt.h,v 1.767 2008/09/01 21:59:43 shane Exp $
|
||||
** @(#) $Id: sqliteInt.h,v 1.768 2008/09/02 00:52:52 drh Exp $
|
||||
*/
|
||||
#ifndef _SQLITEINT_H_
|
||||
#define _SQLITEINT_H_
|
||||
@@ -441,6 +441,20 @@ struct BusyHandler {
|
||||
*/
|
||||
#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3DbFree)
|
||||
|
||||
/*
|
||||
** When SQLITE_OMIT_WSD is defined, it means that the target platform does
|
||||
** not support Writable Static Data (WSD) such as global and static variables.
|
||||
** All variables must either be on the stack or dynamically allocated from
|
||||
** the heap. When WSD is unsupported, the variable declarations scattered
|
||||
** throughout the SQLite code must become constants instead. The SQLITE_WSD
|
||||
** macro is used for this purpose. And instead of referencing the variable
|
||||
** directly, we use its constant as a key to lookup the run-time allocated
|
||||
** buffer that holds real variable. The constant is also the initializer
|
||||
** for the run-time allocated buffer.
|
||||
**
|
||||
** In the usually case where WSD is supported, the SQLITE_WSD and GLOBAL
|
||||
** macros become no-ops and have zero performance impact.
|
||||
*/
|
||||
#ifdef SQLITE_OMIT_WSD
|
||||
#define SQLITE_WSD const
|
||||
#define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v)))
|
||||
|
||||
Reference in New Issue
Block a user