SQLite

Check-in [9ccf8f8d35]
Login

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

Overview
Comment:Remove a superfluous conditional from the memory allocation initialization.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9ccf8f8d35723f2a9b59010b6d5f37a14164a188
User & Date: drh 2015-10-15 17:21:35.142
Context
2015-10-15
17:31
Optimization to the out2Prerelease() helper routine in the VDBE engine. (check-in: 79298fe8c4 user: drh tags: trunk)
17:21
Remove a superfluous conditional from the memory allocation initialization. (check-in: 9ccf8f8d35 user: drh tags: trunk)
16:20
Performance optimizations to the sqlite3MallocSize() by requiring the argument to always be non-NULL. (check-in: cb65989b07 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/malloc.c.
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
*/
int sqlite3MallocInit(void){
  int rc;
  if( sqlite3GlobalConfig.m.xMalloc==0 ){
    sqlite3MemSetDefault();
  }
  memset(&mem0, 0, sizeof(mem0));
  if( sqlite3GlobalConfig.bCoreMutex ){
    mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
  }
  if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100
      && sqlite3GlobalConfig.nScratch>0 ){
    int i, n, sz;
    ScratchFreeslot *pSlot;
    sz = ROUNDDOWN8(sqlite3GlobalConfig.szScratch);
    sqlite3GlobalConfig.szScratch = sz;
    pSlot = (ScratchFreeslot*)sqlite3GlobalConfig.pScratch;







<
|
<







127
128
129
130
131
132
133

134

135
136
137
138
139
140
141
*/
int sqlite3MallocInit(void){
  int rc;
  if( sqlite3GlobalConfig.m.xMalloc==0 ){
    sqlite3MemSetDefault();
  }
  memset(&mem0, 0, sizeof(mem0));

  mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);

  if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100
      && sqlite3GlobalConfig.nScratch>0 ){
    int i, n, sz;
    ScratchFreeslot *pSlot;
    sz = ROUNDDOWN8(sqlite3GlobalConfig.szScratch);
    sqlite3GlobalConfig.szScratch = sz;
    pSlot = (ScratchFreeslot*)sqlite3GlobalConfig.pScratch;