1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Change some more global variables to work with OMIT_WSD. (CVS 5660)

FossilOrigin-Name: 46acaf58e11ebe69e4fb5f171d3ee29f056d8e68
This commit is contained in:
danielk1977
2008-09-02 10:22:00 +00:00
parent 5b775295f0
commit 5c8f858790
7 changed files with 36 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
C Modify\spcache.c\sto\swork\swith\sOMIT_WSD.\s(CVS\s5659)
D 2008-09-02T09:38:07
C Change\ssome\smore\sglobal\svariables\sto\swork\swith\sOMIT_WSD.\s(CVS\s5660)
D 2008-09-02T10:22:01
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 689e14735f862a5553bceef206d8c13e29504e44
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -117,19 +117,19 @@ F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e
F src/legacy.c aac57bd984e666059011ea01ec4383892a253be3
F src/loadext.c 6581a5bbc4d74fcd46dbbcfd695a6a5417f778a2
F src/main.c 756541b024aeaedee0c803f33e06bf16aef19ab6
F src/malloc.c 2ffd62fb4a299cf3945e50a4c53d27ec1813f8b1
F src/malloc.c fb23bfbcc5c93180b787bd746c7387289028d482
F src/mem1.c 5a529ff121c55ab067be14de00f86f6dcc4f4fb9
F src/mem2.c f87e681d0d1ed8436870d089332ed0d27d885b5c
F src/mem3.c afb0ace2be6a9134713f399711bacf7d3cdc60c6
F src/mem3.c 0d9341b01ebbed7bce59a94236620f20bce2efd4
F src/mem4.c 6703adb1717b26d9d70a1c2586b4b7b7ffee7909
F src/mem5.c 7a8e54fd3ca801c2a3cf9060175c008c55715d8b
F src/mem6.c 637d1e65bfcebb68844981cc80f9da4483428539
F src/mem5.c 6ec2795f5c328d8560ce500dad56a2aaedddb2d4
F src/mem6.c 95d19a2e76c9173b1366f0a08a9f79fa34c697f2
F src/mutex.c 81174f600553c25832e9a8705b609f16c73a4c01
F src/mutex.h e52ffa1dfc6a6077e8b1823d2c2b7dfcbcf85594
F src/mutex_os2.c 9c5637aa4c307c552566d0f0b3bd206245b54a97
F src/mutex_unix.c 29049a61755cccddb2ee53904e6906bb7674223c
F src/mutex_w32.c f0d21ff1f6981e5aedc56796adf3a347423ef736
F src/os.c 939ae7690a01d9401685ba124b4ba45fd4a7a2ad
F src/os.c 364d7c79f7437c708c1275eacab4328d51757e73
F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892
F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60
F src/os_os2.c e391fc95adc744bbdcefd4d11e3066998185a0a0
@@ -630,7 +630,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P ef26ea5c46d3915d206f8ff7f82a24f4c8955f1f
R 7736deee443b4d2230f5bd18a13532e4
P 44def90d1bd4e37ab162e16f83e23d32e86b78ab
R 7402c8bee4c430248c86583164bf1a09
U danielk1977
Z eee1cf0558cd99e310064b03fee3f582
Z af41b1479a16ee61f52f69a5df4f2ee5

View File

@@ -1 +1 @@
44def90d1bd4e37ab162e16f83e23d32e86b78ab
46acaf58e11ebe69e4fb5f171d3ee29f056d8e68

View File

@@ -12,7 +12,7 @@
**
** Memory allocation functions used throughout sqlite.
**
** $Id: malloc.c,v 1.38 2008/09/01 18:34:20 danielk1977 Exp $
** $Id: malloc.c,v 1.39 2008/09/02 10:22:01 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -76,7 +76,7 @@ int sqlite3_release_memory(int n){
/*
** State information local to the memory allocation subsystem.
*/
static struct {
static SQLITE_WSD struct Mem0Global {
sqlite3_mutex *mutex; /* Mutex to serialize access */
/*
@@ -102,7 +102,9 @@ static struct {
/* Number of free pages for scratch and page-cache memory */
u32 nScratchFree;
u32 nPageFree;
} mem0;
} mem0 = {};
#define mem0 GLOBAL(struct Mem0Global, mem0)
/*
** Initialize the memory allocation subsystem.

View File

@@ -23,7 +23,7 @@
** This version of the memory allocation subsystem is included
** in the build only if SQLITE_ENABLE_MEMSYS3 is defined.
**
** $Id: mem3.c,v 1.21 2008/09/01 18:34:20 danielk1977 Exp $
** $Id: mem3.c,v 1.22 2008/09/02 10:22:01 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -99,7 +99,7 @@ struct Mem3Block {
** static variables organized and to reduce namespace pollution
** when this module is combined with other in the amalgamation.
*/
static struct {
static SQLITE_WSD struct Mem3Global {
/*
** True if we are evaluating an out-of-memory callback.
*/
@@ -138,7 +138,9 @@ static struct {
*/
u32 nPool;
Mem3Block *aPool;
} mem3;
} mem3 = {};
#define mem3 GLOBAL(struct Mem3Global, mem3)
/*
** Unlink the chunk at mem3.aPool[i] from list it is currently
@@ -583,8 +585,8 @@ static void memsys3Shutdown(void *NotUsed){
** Open the file indicated and write a log of all unfreed memory
** allocations into that log.
*/
#ifdef SQLITE_DEBUG
void sqlite3Memsys3Dump(const char *zFilename){
#ifdef SQLITE_DEBUG
FILE *out;
int i, j;
u32 size;
@@ -651,8 +653,8 @@ void sqlite3Memsys3Dump(const char *zFilename){
}else{
fclose(out);
}
}
#endif
}
/*
** This routine is the only routine in this file with external

View File

@@ -23,7 +23,7 @@
** This version of the memory allocation subsystem is included
** in the build only if SQLITE_ENABLE_MEMSYS5 is defined.
**
** $Id: mem5.c,v 1.12 2008/09/01 18:34:20 danielk1977 Exp $
** $Id: mem5.c,v 1.13 2008/09/02 10:22:01 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -85,7 +85,7 @@ struct Mem5Link {
** static variables organized and to reduce namespace pollution
** when this module is combined with other in the amalgamation.
*/
static struct {
static SQLITE_WSD struct Mem5Global {
/*
** The alarm callback and its arguments. The mem5.mutex lock will
** be held while the callback is running. Recursive calls into
@@ -132,7 +132,9 @@ static struct {
int nAtom; /* Smallest possible allocation in bytes */
int nBlock; /* Number of nAtom sized blocks in zPool */
u8 *zPool;
} mem5;
} mem5 = {};
#define mem5 GLOBAL(struct Mem5Global, mem5)
#define MEM5LINK(idx) ((Mem5Link *)(&mem5.zPool[(idx)*mem5.nAtom]))

View File

@@ -32,7 +32,7 @@
** fragmentation. On some systems, heap fragmentation can cause a
** significant real-time slowdown.
**
** $Id: mem6.c,v 1.8 2008/09/01 18:34:20 danielk1977 Exp $
** $Id: mem6.c,v 1.9 2008/09/02 10:22:01 danielk1977 Exp $
*/
#ifdef SQLITE_ENABLE_MEMSYS6
@@ -104,13 +104,15 @@ struct Mem6Chunk {
#define MEM6LINK(idx) ((Mem6Link *)(&pChunk->zPool[(idx)*pChunk->nAtom]))
struct Mem6Global {
static SQLITE_WSD struct Mem6Global {
int nMinAlloc; /* Minimum allowed allocation size */
int nThreshold; /* Allocs larger than this go to malloc() */
int nLogThreshold; /* log2 of (nThreshold/nMinAlloc) */
sqlite3_mutex *mutex;
Mem6Chunk *pChunk; /* Singly linked list of all memory chunks */
} mem6;
} mem6 = {};
#define mem6 GLOBAL(struct Mem6Global, mem6)
/*
** Unlink the chunk at pChunk->aPool[i] from list it is currently

View File

@@ -13,7 +13,7 @@
** This file contains OS interface code that is common to all
** architectures.
**
** $Id: os.c,v 1.120 2008/07/28 19:34:53 drh Exp $
** $Id: os.c,v 1.121 2008/09/02 10:22:01 danielk1977 Exp $
*/
#define _SQLITE_OS_C_ 1
#include "sqliteInt.h"
@@ -190,7 +190,8 @@ int sqlite3OsCloseFree(sqlite3_file *pFile){
/*
** The list of all registered VFS implementations.
*/
static sqlite3_vfs *vfsList = 0;
static SQLITE_WSD sqlite3_vfs *vfsList = 0;
#define vfsList GLOBAL(sqlite3_vfs *, vfsList)
/*
** Locate a VFS by name. If no name is given, simply return the