model-writtenrun 2617 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Vladlen Popolitov proposed lifting the 2GB maintenance_work_mem limit on 64-bit Windows because it impeded large vector-index builds, supplying a patch and reporting successful Windows and Linux tests in #1.
- David Rowley proposed addressing the related memory settings together and initially suggested a conversion macro in #2; he then objected that the RI_Initial_Check() workaround would prevent referential-integrity validation from using the configured maintenance memory in #4.
- Vladlen agreed to remove the workaround and audit the settings together in #5, while David recommended casts suited to the surrounding arithmetic in #6; the resulting patch changed the shared MAX_KILOBYTES limit and expanded the conversions across memory consumers in #8.
- After several months, Tom Lane reviewed the expanded patch in #10, questioning inconsistent types, unnecessary 64-bit arithmetic on 32-bit machines, the bitmap interfaces, and a stale comment; Vladlen responded with mostly Size-based conversions and explanations for retaining int64 and double in selected places in #11.
- During that audit, Tom found an independent overflow risk in the wal_skip_threshold calculation and committed 49a38238e2, widening the accumulated block count and rearranging the comparison, with backports through PostgreSQL 13.
- Tom extracted the stack-depth portion of #11 into b9d232b9de, extending the changes and using ssize_t because stack-depth calculations and limit reporting require signed values.
- Tom committed the remaining memory-limit work from #11 as 041e8b95b8, adding further arithmetic and type cleanups while removing the Windows-specific restriction.
- In the final message, Tom confirmed the landing, explained the int return type for bitmap entry counts and double planner variable, and agreed that a universal conversion macro was unsuitable because several destination types remained necessary; larger bitmap entry counts were left for future work, with no submitted patch remaining pending #12.