/ Check-in [5e14cadf]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:The first argument to SQLITE_CONFIG_PAGECACHE, SQLITE_CONFIG_SCRATCH, and SQLITE_CONFIG_HEAP must always be a pointer.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5e14cadff09d7425c8e1cc5e817f2b0609e52a46
User & Date: drh 2015-11-26 22:12:41
Context
2015-11-28
17:38
Disable testing with SQLITE_USER_AUTHENTICATION as the makefiles are not set up to do that. check-in: 14bbcdc6 user: drh tags: trunk
2015-11-26
22:12
The first argument to SQLITE_CONFIG_PAGECACHE, SQLITE_CONFIG_SCRATCH, and SQLITE_CONFIG_HEAP must always be a pointer. check-in: 5e14cadf user: drh tags: trunk
15:51
Fix a problem with the userauth extension and no-authentication databases. Run the tests for this extension as part of the Debug-One module in releasetest.tcl. check-in: 8b156219 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pcache1.c.

    61     61   **         SQLITE_CONFIG_PAGECACHE.
    62     62   **    (3)  PCache-local bulk allocation.
    63     63   **
    64     64   ** The third case is a chunk of heap memory (defaulting to 100 pages worth)
    65     65   ** that is allocated when the page cache is created.  The size of the local
    66     66   ** bulk allocation can be adjusted using 
    67     67   **
    68         -**     sqlite3_config(SQLITE_CONFIG_PAGECACHE, 0, 0, N).
           68  +**     sqlite3_config(SQLITE_CONFIG_PAGECACHE, (void*)0, 0, N).
    69     69   **
    70     70   ** If N is positive, then N pages worth of memory are allocated using a single
    71     71   ** sqlite3Malloc() call and that memory is used for the first N pages allocated.
    72     72   ** Or if N is negative, then -1024*N bytes of memory are allocated and used
    73     73   ** for as many pages as can be accomodated.
    74     74   **
    75     75   ** Only one of (2) or (3) can be used.  Once the memory available to (2) or

Changes to src/test_malloc.c.

   906    906       return TCL_ERROR;
   907    907     }
   908    908     if( Tcl_GetIntFromObj(interp, objv[1], &sz) ) return TCL_ERROR;
   909    909     if( Tcl_GetIntFromObj(interp, objv[2], &N) ) return TCL_ERROR;
   910    910     free(buf);
   911    911     if( sz<0 ){
   912    912       buf = 0;
   913         -    rc = sqlite3_config(SQLITE_CONFIG_SCRATCH, 0, 0, 0);
          913  +    rc = sqlite3_config(SQLITE_CONFIG_SCRATCH, (void*)0, 0, 0);
   914    914     }else{
   915    915       buf = malloc( sz*N + 1 );
   916    916       rc = sqlite3_config(SQLITE_CONFIG_SCRATCH, buf, sz, N);
   917    917     }
   918    918     pResult = Tcl_NewObj();
   919    919     Tcl_ListObjAppendElement(0, pResult, Tcl_NewIntObj(rc));
   920    920     Tcl_ListObjAppendElement(0, pResult, Tcl_NewIntObj(N));
................................................................................
   953    953     /* Set the return value */
   954    954     pRes = Tcl_NewObj();
   955    955     Tcl_ListObjAppendElement(0, pRes, Tcl_NewIntObj(sqlite3GlobalConfig.szPage));
   956    956     Tcl_ListObjAppendElement(0, pRes, Tcl_NewIntObj(sqlite3GlobalConfig.nPage));
   957    957     Tcl_SetObjResult(interp, pRes);
   958    958   
   959    959     if( sz<0 ){
   960         -    sqlite3_config(SQLITE_CONFIG_PAGECACHE, 0, 0, 0);
          960  +    sqlite3_config(SQLITE_CONFIG_PAGECACHE, (void*)0, 0, 0);
   961    961     }else{
   962    962       buf = malloc( sz*N );
   963    963       sqlite3_config(SQLITE_CONFIG_PAGECACHE, buf, sz, N);
   964    964     }
   965    965     return TCL_OK;
   966    966   }
   967    967