/ Check-in [24f258c2]
Login

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

Overview
Comment:Remove an unnecessary malloc from the vfsstat extension.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 24f258c2392290168cf34622b89a4a406a3dd853
User & Date: drh 2016-05-28 17:45:15
Context
2016-05-30
08:28
Fix an FTS5 problem (segfault or incorrect query results) with "... MATCH 'x OR y' ORDER BY rank" queries when either token 'x' or 'y' is completely absent from the dataset. check-in: 64ca1a83 user: dan tags: trunk
2016-05-28
18:53
Experimental change to allow virtual tables to take advantage of LIKE, REGEXP and GLOB terms that are part of OR expressions within WHERE clauses. Closed-Leaf check-in: 242507b4 user: dan tags: vtab-experimental
17:45
Remove an unnecessary malloc from the vfsstat extension. check-in: 24f258c2 user: drh tags: trunk
15:22
Enhance "PRAGMA compile_options" so that it shows the version of the compiler used to generate the executable, for common compilers. check-in: 6a0f2009 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/misc/vfsstat.c.

800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
*/
int sqlite3_vfsstat_init(
  sqlite3 *db, 
  char **pzErrMsg, 
  const sqlite3_api_routines *pApi
){
  int rc = SQLITE_OK;
  VStatVfs *pNew;
  SQLITE_EXTENSION_INIT2(pApi);
  pNew = sqlite3_malloc(sizeof(vstat_vfs));
  if( pNew==0 ) return SQLITE_NOMEM;
  memcpy(&pNew->base, &vstat_vfs, sizeof(vstat_vfs));
  pNew->pVfs = sqlite3_vfs_find(0);
  pNew->base.szOsFile = sizeof(VStatFile) + pNew->pVfs->szOsFile;
  rc = sqlite3_vfs_register(&pNew->base, 1);
  if( rc==SQLITE_OK ){
    rc = sqlite3_auto_extension((void(*)(void))vstatRegister);
  }
  return rc;
}







<

<
<
<
|
|
|





800
801
802
803
804
805
806

807



808
809
810
811
812
813
814
815
*/
int sqlite3_vfsstat_init(
  sqlite3 *db, 
  char **pzErrMsg, 
  const sqlite3_api_routines *pApi
){
  int rc = SQLITE_OK;

  SQLITE_EXTENSION_INIT2(pApi);



  vstat_vfs.pVfs = sqlite3_vfs_find(0);
  vstat_vfs.base.szOsFile = sizeof(VStatFile) + pNew->pVfs->szOsFile;
  rc = sqlite3_vfs_register(&vstat_vfs.base, 1);
  if( rc==SQLITE_OK ){
    rc = sqlite3_auto_extension((void(*)(void))vstatRegister);
  }
  return rc;
}