mirror of
https://github.com/postgres/postgres.git
synced 2025-10-29 22:49:41 +03:00
Add PQresultMemorySize function to report allocated size of a PGresult.
This number can be useful for application memory management, and the overhead to track it seems pretty trivial. Lars Kanis, reviewed by Pavel Stehule, some mods by me Discussion: https://postgr.es/m/fa16a288-9685-14f2-97c8-b8ac84365a4f@greiz-reinsdorf.de
This commit is contained in:
@@ -208,6 +208,8 @@ struct pg_result
|
||||
PGresult_data *curBlock; /* most recently allocated block */
|
||||
int curOffset; /* start offset of free space in block */
|
||||
int spaceLeft; /* number of free bytes remaining in block */
|
||||
|
||||
size_t memorySize; /* total space allocated for this PGresult */
|
||||
};
|
||||
|
||||
/* PGAsyncStatusType defines the state of the query-execution state machine */
|
||||
|
||||
Reference in New Issue
Block a user