Lines Matching full:lookaside
2049 ** memory allocation for the lookaside memory allocator on each
2051 ** size of each lookaside buffer slot and the second is the number of
2053 ** <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]
2054 ** verb to [sqlite3_db_config()] can be used to change the lookaside
2141 ** [lookaside memory allocator] configuration for the [database connection].
2143 ** pointer to a memory buffer to use for lookaside memory.
2146 ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the
2147 ** size of each lookaside buffer slot. ^The third argument is the number of
2152 ** rounded down to the next smaller multiple of 8. ^(The lookaside memory
2154 ** connection is not currently using lookaside memory, or in other words
2157 ** Any attempt to change the lookaside memory configuration when lookaside
6503 ** <dd>This parameter returns the number of lookaside memory slots currently
6508 ** satisfied using lookaside memory. Only the high-water value is meaningful;
6514 ** been satisfied using lookaside memory but failed due to the amount of
6515 ** memory requested being larger than the lookaside slot size.
6522 ** been satisfied using lookaside memory but failed due to all lookaside
6543 ** and lookaside memory used by all prepared statements associated with
8144 typedef struct Lookaside Lookaside;
9666 ** Lookaside malloc is a set of fixed-size buffers that can be used
9669 ** lookaside malloc provides a significant performance enhancement
9673 ** The Lookaside structure holds configuration information about the
9674 ** lookaside malloc subsystem. Each available memory allocation in
9675 ** the lookaside subsystem is stored on a linked list of LookasideSlot
9678 ** Lookaside allocations are only allowed for objects that are associated
9680 ** be stored in lookaside because in shared cache mode the schema information
9682 ** schema information, the Lookaside.bEnabled flag is cleared so that
9683 ** lookaside allocations are not used to construct the schema objects.
9685 struct Lookaside {
9687 u8 bEnabled; /* False to disable new lookaside allocations */
9773 Lookaside lookaside; /* Lookaside malloc configuration */
11308 sqlite3 *db; /* Optional database for lookaside. Can be NULL */
11341 int szLookaside; /* Default lookaside buffer size */
11342 int nLookaside; /* Default lookaside buffer count */
12159 ** it might have been allocated by lookaside, except the allocation was
12160 ** too large or lookaside was already full. It is important to verify
12161 ** that allocations that might have been satisfied by lookaside are not
12162 ** passed back to non-lookaside free() routines. Asserts such as the
12163 ** example above are placed on the non-lookaside free() routines to verify
12179 #define MEMTYPE_LOOKASIDE 0x02 /* Might have been lookaside memory */
13398 *pCurrent = db->lookaside.nOut;
13399 *pHighwater = db->lookaside.mxOut;
13401 db->lookaside.mxOut = db->lookaside.nOut;
13415 *pHighwater = db->lookaside.anStat[op - SQLITE_DBSTATUS_LOOKASIDE_HIT];
13417 db->lookaside.anStat[op - SQLITE_DBSTATUS_LOOKASIDE_HIT] = 0;
19017 ** TRUE if p is a lookaside memory allocation from db
19021 return p && p>=db->lookaside.pStart && p<db->lookaside.pEnd;
19039 return db->lookaside.sz;
19079 pBuf->pNext = db->lookaside.pFree;
19080 db->lookaside.pFree = pBuf;
19081 db->lookaside.nOut--;
19206 if( db->lookaside.bEnabled ){
19207 if( n>db->lookaside.sz ){
19208 db->lookaside.anStat[1]++;
19209 }else if( (pBuf = db->lookaside.pFree)==0 ){
19210 db->lookaside.anStat[2]++;
19212 db->lookaside.pFree = pBuf->pNext;
19213 db->lookaside.nOut++;
19214 db->lookaside.anStat[0]++;
19215 if( db->lookaside.nOut>db->lookaside.mxOut ){
19216 db->lookaside.mxOut = db->lookaside.nOut;
19232 ((db && db->lookaside.bEnabled) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
19249 if( n<=db->lookaside.sz ){
19254 memcpy(pNew, p, db->lookaside.sz);
19267 (db->lookaside.bEnabled ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
80230 assert( db->lookaside.bEnabled==0 );
80406 int lookasideEnabled = db->lookaside.bEnabled;
80407 db->lookaside.bEnabled = 0;
80409 db->lookaside.bEnabled = lookasideEnabled;
83026 u8 enableLookaside = db->lookaside.bEnabled;
83030 db->lookaside.bEnabled = 0;
83039 db->lookaside.bEnabled = enableLookaside;
88381 ** the lookaside buffer belonging to database handle dbMem.
88761 u8 enableLookaside; /* Copy of db->lookaside.bEnabled */
88869 /* Disable lookaside memory allocation */
88870 enableLookaside = db->lookaside.bEnabled;
88871 db->lookaside.bEnabled = 0;
88893 /* Re-enable the lookaside buffer, if it was disabled earlier. */
88894 db->lookaside.bEnabled = enableLookaside;
95930 /* The sqlite3ResultSetOfSelect() is only used n contexts where lookaside
95932 assert( db->lookaside.bEnabled==0 );
109970 pParse->db->lookaside.bEnabled = 0;
110978 pParse->db->lookaside.bEnabled = 0;
111964 u8 enableLookaside; /* Saved value of db->lookaside.bEnabled */
111987 enableLookaside = db->lookaside.bEnabled;
111988 if( db->lookaside.pStart ) db->lookaside.bEnabled = 1;
112042 db->lookaside.bEnabled = enableLookaside;
112939 ** Set up the lookaside buffers for a database connection.
112941 ** If lookaside is already active, return SQLITE_BUSY.
112943 ** The sz parameter is the number of bytes in each lookaside slot.
112945 ** space for the lookaside memory is obtained from sqlite3_malloc().
112947 ** the lookaside memory.
112951 if( db->lookaside.nOut ){
112954 /* Free any existing lookaside buffer for this handle before
112958 if( db->lookaside.bMalloced ){
112959 sqlite3_free(db->lookaside.pStart);
112961 /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger
112978 db->lookaside.pStart = pStart;
112979 db->lookaside.pFree = 0;
112980 db->lookaside.sz = (u16)sz;
112987 p->pNext = db->lookaside.pFree;
112988 db->lookaside.pFree = p;
112991 db->lookaside.pEnd = p;
112992 db->lookaside.bEnabled = 1;
112993 db->lookaside.bMalloced = pBuf==0 ?1:0;
112995 db->lookaside.pEnd = 0;
112996 db->lookaside.bEnabled = 0;
112997 db->lookaside.bMalloced = 0;
113315 assert( db->lookaside.nOut==0 ); /* Fails on a lookaside memory leak */
113316 if( db->lookaside.bMalloced ){
113317 sqlite3_free(db->lookaside.pStart);
114785 /* Enable the lookaside-malloc subsystem */