On Thu, 20 Dec 2018 at 05:44, Tom Lane wrote:
> I don't think this is quite bulletproof against overflow, especially
> in view of the rather careless mixing of int32 and uint32 variables
> that exists here. The easiest way to make it bulletproof is to add
> an explicit test, so I did that and pus
David Rowley writes:
> On Wed, 19 Dec 2018 at 04:24, Tom Lane wrote:
>> Also, do we need to worry about integer overflow?
> Good point. I didn't think of it before, but the previous code would
> have ensured that we got an ERROR before any overflow could have
> occurred as the repalloc() would
On Wed, 19 Dec 2018 at 04:24, Tom Lane wrote:
>
> David Rowley writes:
> > I recently stumbled upon the following code in ginfast.c:
> > while (collector->ntuples + nentries > collector->lentuples)
> > {
> > collector->lentuples *= 2;
> > collector->tuples = (IndexTuple *) repalloc(collec
David Rowley writes:
> I recently stumbled upon the following code in ginfast.c:
> while (collector->ntuples + nentries > collector->lentuples)
> {
> collector->lentuples *= 2;
> collector->tuples = (IndexTuple *) repalloc(collector->tuples,
> sizeof(IndexTuple) * collector->lentuple
I recently stumbled upon the following code in ginfast.c:
while (collector->ntuples + nentries > collector->lentuples)
{
collector->lentuples *= 2;
collector->tuples = (IndexTuple *) repalloc(collector->tuples,
sizeof(IndexTuple) * collector->lentuples);
}
it does not seem very smar