/ Check-in [8a0d5d5e9a]
Login

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

Overview
Comment:Fix the sqlite3_memory_used() and sqlite3_memory_highwater() interfaces so that they really do provide a 64-bit answer.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8a0d5d5e9a4515603c47e9354af47550155a6f2d
User & Date: drh 2015-05-10 02:01:08
Context
2015-05-11
06:22
Change autoconf/Makefile.am to avoid building target sqlite3.o as part of both the shared library and shell tool. Doing so causes problems for parallel builds. check-in: 85bfa9a67f user: dan tags: trunk
2015-05-10
02:01
Fix the sqlite3_memory_used() and sqlite3_memory_highwater() interfaces so that they really do provide a 64-bit answer. check-in: 8a0d5d5e9a user: drh tags: trunk
2015-05-09
12:14
Version 3.8.10.1 check-in: 05b4b1f2a9 user: drh tags: trunk, release, version-3.8.10.1
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/malloc.c.

   222    222     memset(&mem0, 0, sizeof(mem0));
   223    223   }
   224    224   
   225    225   /*
   226    226   ** Return the amount of memory currently checked out.
   227    227   */
   228    228   sqlite3_int64 sqlite3_memory_used(void){
   229         -  int n, mx;
   230         -  sqlite3_int64 res;
   231         -  sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, 0);
   232         -  res = (sqlite3_int64)n;  /* Work around bug in Borland C. Ticket #3216 */
          229  +  sqlite3_int64 res, mx;
          230  +  sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
   233    231     return res;
   234    232   }
   235    233   
   236    234   /*
   237    235   ** Return the maximum amount of memory that has ever been
   238    236   ** checked out since either the beginning of this process
   239    237   ** or since the most recent reset.
   240    238   */
   241    239   sqlite3_int64 sqlite3_memory_highwater(int resetFlag){
   242         -  int n, mx;
   243         -  sqlite3_int64 res;
   244         -  sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, resetFlag);
   245         -  res = (sqlite3_int64)mx;  /* Work around bug in Borland C. Ticket #3216 */
   246         -  return res;
          240  +  sqlite3_int64 res, mx;
          241  +  sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
          242  +  return mx;
   247    243   }
   248    244   
   249    245   /*
   250    246   ** Trigger the alarm 
   251    247   */
   252    248   static void sqlite3MallocAlarm(int nByte){
   253    249     void (*xCallback)(void*,sqlite3_int64,int);