aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-05-10 02:01:08 +0000
committerdrh <drh@noemail.net>2015-05-10 02:01:08 +0000
commitdf5e1a00de2a3f75f03e5f2ee457b1ce48a2420c (patch)
tree3d4c8f8ad224689822402f528aba26f0d29ff6ed /src
parenta16cd04b430c0d8e3b51fe3db94a99b88ca156b5 (diff)
downloadsqlite-df5e1a00de2a3f75f03e5f2ee457b1ce48a2420c.tar.gz
sqlite-df5e1a00de2a3f75f03e5f2ee457b1ce48a2420c.zip
Fix the sqlite3_memory_used() and sqlite3_memory_highwater() interfaces so
that they really do provide a 64-bit answer. FossilOrigin-Name: 8a0d5d5e9a4515603c47e9354af47550155a6f2d
Diffstat (limited to 'src')
-rw-r--r--src/malloc.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/malloc.c b/src/malloc.c
index f06e27d84..70b834579 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -226,10 +226,8 @@ void sqlite3MallocEnd(void){
** Return the amount of memory currently checked out.
*/
sqlite3_int64 sqlite3_memory_used(void){
- int n, mx;
- sqlite3_int64 res;
- sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, 0);
- res = (sqlite3_int64)n; /* Work around bug in Borland C. Ticket #3216 */
+ sqlite3_int64 res, mx;
+ sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0);
return res;
}
@@ -239,11 +237,9 @@ sqlite3_int64 sqlite3_memory_used(void){
** or since the most recent reset.
*/
sqlite3_int64 sqlite3_memory_highwater(int resetFlag){
- int n, mx;
- sqlite3_int64 res;
- sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, resetFlag);
- res = (sqlite3_int64)mx; /* Work around bug in Borland C. Ticket #3216 */
- return res;
+ sqlite3_int64 res, mx;
+ sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag);
+ return mx;
}
/*