mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Fix the sqlite3_memory_used() and sqlite3_memory_highwater() interfaces so
that they really do provide a 64-bit answer. FossilOrigin-Name: 8a0d5d5e9a4515603c47e9354af47550155a6f2d
This commit is contained in:
14
src/malloc.c
14
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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user