勇芳软件工作室.汉化:  SQLite3 API Functions > Memory Allocation >

sqlite3_memory_highwater

Previous pageReturn to chapter overviewNext page

描述

 

自上次重置高水位线以来,返回值为sqlite3_memory_used的最大值。

 

C / C ++语法

 

sqlite3_int64 sqlite3_memory_highwater(int resetFlag);

 

PB语法

 

FUNCTION sqlite3_memory_highwater ( _

BYVAL resetFlag AS LONG _

) AS QUAD

 

参数

 

resetFlag

 

[in]TRUE或FALSE。重置高水位标记。

 

返回值

 

自从上一次重置高水位标记以来,目前尚未完成(内存但未释放)的内存的字节数。

 

备注

 

sqlite3_memory_highwater返回的值包括SQLite在实现sqlite3_malloc时添加的任何开销,但不包括sqlite3_malloc可能调用的任何基础系统库函数的开销。

 

C ++实现代码

 

/*

** Return the maximum amount of memory that has ever been

** checked out since either the beginning of this process

** or since the most recent reset.

*/

SQLITE_API 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;

}