Fix bogus use of "long" in AllocSetCheck() Because long is 32-bit on 64-bit Windows, it isn't a good datatype to store the difference between 2 pointers. The under-sized type could overflow and lead to scary warnings in MEMORY_CONTEXT_CHECKING builds, such as:
WARNING: problem in alloc set ExecutorState: bad single-chunk %p in block %p However, the problem lies only in the code running the check, not from an actual memory accounting bug. Fix by using "Size" instead of "long". This means using an unsigned type rather than the previous signed type. If the block's freeptr was corrupted, we'd still catch that if the unsigned type wrapped. Unsigned allows us to avoid further needless complexities around comparing signed and unsigned types. Author: David Rowley <[email protected]> Reviewed-by: Michael Paquier <[email protected]> Reviewed-by: Tom Lane <[email protected]> Backpatch-through: 13 Discussion: https://postgr.es/m/CAApHDvo-RmiT4s33J=ac9c_-wpzjoxq232v-ezfgkftssnr...@mail.gmail.com Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/af3a79e0837d23fa536f859fc927b1379855ae24 Modified Files -------------- src/backend/utils/mmgr/aset.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
