]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Explicitly initialize at least the first field of every struct. This is to work aroun...
authordanielk1977 <danielk1977@noemail.net>
Tue, 2 Sep 2008 17:52:51 +0000 (17:52 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Tue, 2 Sep 2008 17:52:51 +0000 (17:52 +0000)
FossilOrigin-Name: 88bfdc87471e65ac5a262a794b8cdf3e563eb327

manifest
manifest.uuid
src/malloc.c
src/mem3.c
src/mem5.c
src/mem6.c

index 58af336302d1cd03d73627557ec0d768846665dd..06e3e94b1d5fa7e364c4b2fe8041c6f1ea2e406f 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sthe\sposition\sof\sthe\sSQLITE_WSD\smacro\sin\sthe\sdeclaration\sof\sglobal\svariable\svfsList.\s(CVS\s5665)
-D 2008-09-02T17:18:52
+C Explicitly\sinitialize\sat\sleast\sthe\sfirst\sfield\sof\severy\sstruct.\sThis\sis\sto\swork\saround\scompilers\sthat\sdon't\slike\sthe\ssyntax\s"struct\sXXX\s{\s...\s}\syyy\s=\s{};".\s(CVS\s5666)
+D 2008-09-02T17:52:52
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 689e14735f862a5553bceef206d8c13e29504e44
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -117,13 +117,13 @@ F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e
 F src/legacy.c aac57bd984e666059011ea01ec4383892a253be3
 F src/loadext.c 6581a5bbc4d74fcd46dbbcfd695a6a5417f778a2
 F src/main.c a679dd3e0f040d13d72b9800840e07bedd6aa2d4
-F src/malloc.c fb23bfbcc5c93180b787bd746c7387289028d482
+F src/malloc.c 9aa2ef805287017ed16a9e3809d275b8af26b762
 F src/mem1.c 5a529ff121c55ab067be14de00f86f6dcc4f4fb9
 F src/mem2.c f87e681d0d1ed8436870d089332ed0d27d885b5c
-F src/mem3.c 0d9341b01ebbed7bce59a94236620f20bce2efd4
+F src/mem3.c 1594f117fde4cf11a6c16521f3f30af8d04bbe68
 F src/mem4.c 6703adb1717b26d9d70a1c2586b4b7b7ffee7909
-F src/mem5.c 6ec2795f5c328d8560ce500dad56a2aaedddb2d4
-F src/mem6.c 95d19a2e76c9173b1366f0a08a9f79fa34c697f2
+F src/mem5.c 706d462c13a9819dfec7c10d9dccedf8d199960c
+F src/mem6.c febe4db9ddef73df500989e68a9d4ac68602a075
 F src/mutex.c 81174f600553c25832e9a8705b609f16c73a4c01
 F src/mutex.h e52ffa1dfc6a6077e8b1823d2c2b7dfcbcf85594
 F src/mutex_os2.c 9c5637aa4c307c552566d0f0b3bd206245b54a97
@@ -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 af5763eb65baa791a38f7e235624e4f63beac104
-R 614d8789ebf6e763073894eea03bb50c
+P e869446119724b9b1568b1f8e56e9f29ff6d3816
+R 9d15214be0d8a6dfee557461b3e13e4a
 U danielk1977
-Z 89924553a58b9babc004b5df11c6ef86
+Z a4210662dddf1b4f707bdd6daa55e785
index 7376f0e758a6304281938b784962ab29580ae182..35dd0fd74fc98a68cbc787579d423d09dc89d5dd 100644 (file)
@@ -1 +1 @@
-e869446119724b9b1568b1f8e56e9f29ff6d3816
\ No newline at end of file
+88bfdc87471e65ac5a262a794b8cdf3e563eb327
\ No newline at end of file
index 1fc8b4f93324cb215e744571715013f5bfc5af05..61e1c1dbff58b3d54e52a19c59a5430d82eba884 100644 (file)
@@ -12,7 +12,7 @@
 **
 ** Memory allocation functions used throughout sqlite.
 **
-** $Id: malloc.c,v 1.39 2008/09/02 10:22:01 danielk1977 Exp $
+** $Id: malloc.c,v 1.40 2008/09/02 17:52:52 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include <stdarg.h>
@@ -77,6 +77,10 @@ int sqlite3_release_memory(int n){
 ** State information local to the memory allocation subsystem.
 */
 static SQLITE_WSD struct Mem0Global {
+  /* Number of free pages for scratch and page-cache memory */
+  u32 nScratchFree;
+  u32 nPageFree;
+
   sqlite3_mutex *mutex;         /* Mutex to serialize access */
 
   /*
@@ -98,11 +102,7 @@ static SQLITE_WSD struct Mem0Global {
   */
   u32 *aScratchFree;
   u32 *aPageFree;
-
-  /* Number of free pages for scratch and page-cache memory */
-  u32 nScratchFree;
-  u32 nPageFree;
-} mem0 = {};
+} mem0 = { 62560955 };
 
 #define mem0 GLOBAL(struct Mem0Global, mem0)
 
index 0379ade8a2c5cc5b0617243d380ed7de791124c8..1c2c9511c2f02bee00493e7ebb46c126c2d79c73 100644 (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.22 2008/09/02 10:22:01 danielk1977 Exp $
+** $Id: mem3.c,v 1.23 2008/09/02 17:52:52 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 
@@ -100,6 +100,13 @@ struct Mem3Block {
 ** when this module is combined with other in the amalgamation.
 */
 static SQLITE_WSD struct Mem3Global {
+  /*
+  ** Memory available for allocation. nPool is the size of the array
+  ** (in Mem3Blocks) pointed to by aPool less 2.
+  */
+  u32 nPool;
+  Mem3Block *aPool;
+
   /*
   ** True if we are evaluating an out-of-memory callback.
   */
@@ -131,14 +138,7 @@ static SQLITE_WSD struct Mem3Global {
   */
   u32 aiSmall[MX_SMALL-1];   /* For sizes 2 through MX_SMALL, inclusive */
   u32 aiHash[N_HASH];        /* For sizes MX_SMALL+1 and larger */
-
-  /*
-  ** Memory available for allocation. nPool is the size of the array
-  ** (in Mem3Blocks) pointed to by aPool less 2.
-  */
-  u32 nPool;
-  Mem3Block *aPool;
-} mem3 = {};
+} mem3 = { 97535575 };
 
 #define mem3 GLOBAL(struct Mem3Global, mem3)
 
index 1ce0442480e85549e976da0e2e6ef07baad0a64d..6044bd8abc09d95b63ef12cd0fe9fbd4c607fda7 100644 (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.13 2008/09/02 10:22:01 danielk1977 Exp $
+** $Id: mem5.c,v 1.14 2008/09/02 17:52:52 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 
@@ -87,16 +87,11 @@ struct Mem5Link {
 */
 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
-  ** the memory subsystem are allowed, but no new callbacks will be
-  ** issued.  The alarmBusy variable is set to prevent recursive
-  ** callbacks.
+  ** Memory available for allocation
   */
-  sqlite3_int64 alarmThreshold;
-  void (*alarmCallback)(void*, sqlite3_int64,int);
-  void *alarmArg;
-  int alarmBusy;
+  int nAtom;       /* Smallest possible allocation in bytes */
+  int nBlock;      /* Number of nAtom sized blocks in zPool */
+  u8 *zPool;
   
   /*
   ** Mutex to control access to the memory allocation subsystem.
@@ -126,13 +121,7 @@ static SQLITE_WSD struct Mem5Global {
   */
   u8 *aCtrl;
 
-  /*
-  ** Memory available for allocation
-  */
-  int nAtom;       /* Smallest possible allocation in bytes */
-  int nBlock;      /* Number of nAtom sized blocks in zPool */
-  u8 *zPool;
-} mem5 = {};
+} mem5 = { 19804167 };
 
 #define mem5 GLOBAL(struct Mem5Global, mem5)
 
index 168262fbae091b4281f9e7c324e1a7788eda1dcb..8a1be5ee738eb6569df1965d2a42b6e69c39a75a 100644 (file)
@@ -32,7 +32,7 @@
 ** fragmentation. On some systems, heap fragmentation can cause a 
 ** significant real-time slowdown.
 **
-** $Id: mem6.c,v 1.9 2008/09/02 10:22:01 danielk1977 Exp $
+** $Id: mem6.c,v 1.10 2008/09/02 17:52:52 danielk1977 Exp $
 */
 
 #ifdef SQLITE_ENABLE_MEMSYS6
@@ -110,7 +110,7 @@ static SQLITE_WSD struct Mem6Global {
   int nLogThreshold;              /* log2 of (nThreshold/nMinAlloc) */
   sqlite3_mutex *mutex;
   Mem6Chunk *pChunk;              /* Singly linked list of all memory chunks */
-} mem6 = {};
+} mem6 = { 48642791 };
 
 #define mem6 GLOBAL(struct Mem6Global, mem6)