Lines Matching refs:Lookaside
1908 ** memory allocation for the lookaside memory allocator on each
1910 ** size of each lookaside buffer slot and the second is the number of
1912 ** <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]
1913 ** verb to [sqlite3_db_config()] can be used to change the lookaside
1980 ** [lookaside memory allocator] configuration for the [database connection].
1982 ** pointer to an memory buffer to use for lookaside memory.
1985 ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the
1986 ** size of each lookaside buffer slot. ^The third argument is the number of
1991 ** rounded down to the next smaller multiple of 8. ^(The lookaside memory
1993 ** connection is not currently using lookaside memory, or in other words
1996 ** Any attempt to change the lookaside memory configuration when lookaside
6042 ** <dd>This parameter returns the number of lookaside memory slots currently
6061 ** and lookaside memory used by all prepared statements associated with
7385 typedef struct Lookaside Lookaside;
8862 ** Lookaside malloc is a set of fixed-size buffers that can be used
8865 ** lookaside malloc provides a significant performance enhancement
8869 ** The Lookaside structure holds configuration information about the
8870 ** lookaside malloc subsystem. Each available memory allocation in
8871 ** the lookaside subsystem is stored on a linked list of LookasideSlot
8874 ** Lookaside allocations are only allowed for objects that are associated
8876 ** be stored in lookaside because in shared cache mode the schema information
8878 ** schema information, the Lookaside.bEnabled flag is cleared so that
8879 ** lookaside allocations are not used to construct the schema objects.
8881 struct Lookaside {
8883 u8 bEnabled; /* False to disable new lookaside allocations */
8989 Lookaside lookaside; /* Lookaside malloc configuration */
10511 sqlite3 *db; /* Optional database for lookaside. Can be NULL */
10543 int szLookaside; /* Default lookaside buffer size */
10544 int nLookaside; /* Default lookaside buffer count */
11315 ** it might have been allocated by lookaside, except the allocation was
11316 ** too large or lookaside was already full. It is important to verify
11317 ** that allocations that might have been satisfied by lookaside are not
11318 ** passed back to non-lookaside free() routines. Asserts such as the
11319 ** example above are placed on the non-lookaside free() routines to verify
11335 #define MEMTYPE_LOOKASIDE 0x02 /* Might have been lookaside memory */
12511 *pCurrent = db->lookaside.nOut;
12512 *pHighwater = db->lookaside.mxOut;
12514 db->lookaside.mxOut = db->lookaside.nOut;
17892 ** TRUE if p is a lookaside memory allocation from db
17896 return p && p>=db->lookaside.pStart && p<db->lookaside.pEnd;
17914 return db->lookaside.sz;
17954 pBuf->pNext = db->lookaside.pFree;
17955 lookaside.pFree = pBuf;
17956 db->lookaside.nOut--;
18080 if( db->lookaside.bEnabled && n<=db->lookaside.sz
18081 && (pBuf = db->lookaside.pFree)!=0 ){
18082 db->lookaside.pFree = pBuf->pNext;
18083 db->lookaside.nOut++;
18084 if( db->lookaside.nOut>db->lookaside.mxOut ){
18085 db->lookaside.mxOut = db->lookaside.nOut;
18100 ((db && db->lookaside.bEnabled) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
18117 if( n<=db->lookaside.sz ){
18122 memcpy(pNew, p, db->lookaside.sz);
18135 (db->lookaside.bEnabled ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
76618 u8 enableLookaside = db->lookaside.bEnabled;
76622 db->lookaside.bEnabled = 0;
76631 db->lookaside.bEnabled = enableLookaside;
81828 ** the lookaside buffer belonging to database handle dbMem.
82193 u8 enableLookaside; /* Copy of db->lookaside.bEnabled */
82301 /* Disable lookaside memory allocation */
82302 enableLookaside = db->lookaside.bEnabled;
82303 db->lookaside.bEnabled = 0;
82325 /* Re-enable the lookaside buffer, if it was disabled earlier. */
82326 db->lookaside.bEnabled = enableLookaside;
89207 /* The sqlite3ResultSetOfSelect() is only used n contexts where lookaside
89209 assert( db->lookaside.bEnabled==0 );
102340 pParse->db->lookaside.bEnabled = 0;
103320 pParse->db->lookaside.bEnabled = 0;
104306 u8 enableLookaside; /* Saved value of db->lookaside.bEnabled */
104330 enableLookaside = db->lookaside.bEnabled;
104331 if( db->lookaside.pStart ) db->lookaside.bEnabled = 1;
104385 db->lookaside.bEnabled = enableLookaside;
105246 ** Set up the lookaside buffers for a database connection.
105248 ** If lookaside is already active, return SQLITE_BUSY.
105250 ** The sz parameter is the number of bytes in each lookaside slot.
105252 ** space for the lookaside memory is obtained from sqlite3_malloc().
105254 ** the lookaside memory.
105258 if( db->lookaside.nOut ){
105261 /* Free any existing lookaside buffer for this handle before
105265 if( db->lookaside.bMalloced ){
105266 sqlite3_free(db->lookaside.pStart);
105268 /* The size of a lookaside slot needs to be larger than a pointer
105285 db->lookaside.pStart = pStart;
105286 lookaside.pFree = 0;
105287 db->lookaside.sz = (u16)sz;
105294 p->pNext = db->lookaside.pFree;
105295 db->lookaside.pFree = p;
105298 db->lookaside.pEnd = p;
105299 db->lookaside.bEnabled = 1;
105300 db->lookaside.bMalloced = pBuf==0 ?1:0;
105302 db->lookaside.pEnd = 0;
105303 db->lookaside.bEnabled = 0;
105304 db->lookaside.bMalloced = 0;
105579 assert( db->lookaside.nOut==0 ); /* Fails on a lookaside memory leak */
105580 if( db->lookaside.bMalloced ){
105581 sqlite3_free(db->lookaside.pStart);
106783 /* Enable the lookaside-malloc subsystem */