1
0
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:
Tom Lane
2018-09-11 18:45:02 -04:00
parent e7a2217978
commit 2970afa6cf
5 changed files with 70 additions and 6 deletions

View File

@@ -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 */