SQLite

Check-in [977ae12c36]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Conditionally omit prototypes in pcache.h when the corresponding routines are not used. Ticket #3430. (CVS 5805)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 977ae12c365846e1bc582fd17146151953b5ed68
User & Date: drh 2008-10-11 17:42:29.000
Context
2008-10-11
17:51
When transfering an error message from a statement handle to the database handle so that it can be accessed by sqlite3_errmsg(), a malloc may fail. If this malloc fails, it is considered benign. (CVS 5806) (check-in: 311003aff8 user: danielk1977 tags: trunk)
17:42
Conditionally omit prototypes in pcache.h when the corresponding routines are not used. Ticket #3430. (CVS 5805) (check-in: 977ae12c36 user: drh tags: trunk)
17:35
Fix to sqlite3DbMallocRaw() when SQLITE_OMIT_LOOKASIDE is defined so that once it fails it continues to fail. Add a comment explaining why this is important. (CVS 5804) (check-in: 63dd8be70d user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pcache.h.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This header file defines the interface that the sqlite page cache
** subsystem. 
**
** @(#) $Id: pcache.h,v 1.12 2008/09/29 11:49:48 danielk1977 Exp $
*/

#ifndef _PCACHE_H_

typedef struct PgHdr PgHdr;
typedef struct PCache PCache;








|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This header file defines the interface that the sqlite page cache
** subsystem. 
**
** @(#) $Id: pcache.h,v 1.13 2008/10/11 17:42:29 drh Exp $
*/

#ifndef _PCACHE_H_

typedef struct PgHdr PgHdr;
typedef struct PCache PCache;

143
144
145
146
147
148
149

150
151
152
153
154

155
156
157
158
159
160
161
162
163
164

165
166

167

168

169
170
void sqlite3PcacheRef(PgHdr*);

int sqlite3PcachePageRefcount(PgHdr*);

/* Return the total number of pages stored in the cache */
int sqlite3PcachePagecount(PCache*);


/* Iterate through all pages currently stored in the cache. This interface
** is only available if SQLITE_CHECK_PAGES is defined when the library is 
** built.
*/
void sqlite3PcacheIterate(PCache *pCache, void (*xIter)(PgHdr *));


/* Set and get the suggested cache-size for the specified pager-cache.
**
** If no global maximum is configured, then the system attempts to limit
** the total number of pages cached by purgeable pager-caches to the sum
** of the suggested cache-sizes.
*/
int sqlite3PcacheGetCachesize(PCache *);
void sqlite3PcacheSetCachesize(PCache *, int);


/* Try to return memory used by the pcache module to the main memory heap */
int sqlite3PcacheReleaseMemory(int);



void sqlite3PcacheStats(int*,int*,int*,int*);


#endif /* _PCACHE_H_ */







>





>










>


>

>

>


143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
void sqlite3PcacheRef(PgHdr*);

int sqlite3PcachePageRefcount(PgHdr*);

/* Return the total number of pages stored in the cache */
int sqlite3PcachePagecount(PCache*);

#ifdef SQLITE_CHECK_PAGES
/* Iterate through all pages currently stored in the cache. This interface
** is only available if SQLITE_CHECK_PAGES is defined when the library is 
** built.
*/
void sqlite3PcacheIterate(PCache *pCache, void (*xIter)(PgHdr *));
#endif

/* Set and get the suggested cache-size for the specified pager-cache.
**
** If no global maximum is configured, then the system attempts to limit
** the total number of pages cached by purgeable pager-caches to the sum
** of the suggested cache-sizes.
*/
int sqlite3PcacheGetCachesize(PCache *);
void sqlite3PcacheSetCachesize(PCache *, int);

#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
/* Try to return memory used by the pcache module to the main memory heap */
int sqlite3PcacheReleaseMemory(int);
#endif

#ifdef SQLITE_TEST
void sqlite3PcacheStats(int*,int*,int*,int*);
#endif

#endif /* _PCACHE_H_ */