/ Check-in [2d6dd7c2]
Login

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

Overview
Comment:Avoid unnecessary (no-op) calls to sqlite3DbFree() from sqlite3VdbeMemRelease().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2d6dd7c2eb5a64f8994162b564a99ef0014b7460
User & Date: drh 2013-12-09 03:07:21
Context
2013-12-09
12:24
Fix an incorrect test number in the output of the speedtest1.c program. No changes to the test algorithms. check-in: fbfc075a user: drh tags: trunk
03:07
Avoid unnecessary (no-op) calls to sqlite3DbFree() from sqlite3VdbeMemRelease(). check-in: 2d6dd7c2 user: drh tags: trunk
02:32
Use memmove() rather than a home-made copy loop in insertCell() too. check-in: a3d796b1 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbemem.c.

291
292
293
294
295
296
297

298
299
300

301

302
303
304
305
306
307
308
/*
** Release any memory held by the Mem. This may leave the Mem in an
** inconsistent state, for example with (Mem.z==0) and
** (Mem.type==SQLITE_TEXT).
*/
void sqlite3VdbeMemRelease(Mem *p){
  VdbeMemRelease(p);

  sqlite3DbFree(p->db, p->zMalloc);
  p->z = 0;
  p->zMalloc = 0;

  p->xDel = 0;

}

/*
** Convert a 64-bit IEEE double into a 64-bit signed integer.
** If the double is out of range of a 64-bit signed integer then
** return the closest available 64-bit signed integer.
*/







>
|
<
|
>
|
>







291
292
293
294
295
296
297
298
299

300
301
302
303
304
305
306
307
308
309
310
/*
** Release any memory held by the Mem. This may leave the Mem in an
** inconsistent state, for example with (Mem.z==0) and
** (Mem.type==SQLITE_TEXT).
*/
void sqlite3VdbeMemRelease(Mem *p){
  VdbeMemRelease(p);
  if( p->zMalloc ){
    sqlite3DbFree(p->db, p->zMalloc);

    p->zMalloc = 0;
  }
  p->z = 0;
  assert( p->xDel==0 );  /* Zeroed by VdbeMemRelease() above */
}

/*
** Convert a 64-bit IEEE double into a 64-bit signed integer.
** If the double is out of range of a 64-bit signed integer then
** return the closest available 64-bit signed integer.
*/