Thread
-
Re: Fix and improve allocation formulas
Bertrand Drouvot <bertranddrouvot.pg@gmail.com> — 2025-12-17T09:24:31Z
Hi, On Wed, Dec 17, 2025 at 05:19:33PM +0900, Michael Paquier wrote: > On Thu, Dec 11, 2025 at 01:27:56PM +0000, Bertrand Drouvot wrote: > diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c > index c9b24df7c05..1cd5fa791c0 100644 > --- a/src/bin/pg_verifybackup/pg_verifybackup.c > +++ b/src/bin/pg_verifybackup/pg_verifybackup.c > @@ -1007,7 +1007,7 @@ verify_tar_file(verifier_context *context, char *relpath, char *fullpath, > return; > } > > - buffer = pg_malloc(READ_CHUNK_SIZE * sizeof(uint8)); > + buffer = pg_malloc(READ_CHUNK_SIZE * sizeof(char)); > > /* Perform the reads */ > while ((rc = read(fd, buffer, READ_CHUNK_SIZE)) > 0) > > This one reads the same to me, still it seems to me that the intention > is to deal with a byte array. Doesn't this point to the fact that > using uint8 is more adapted for the astreamer code, following changes > like b28c59a6cd08? That would be a more invasive change, of course. While I think that would make sense to follow the b28c59a6cd08 approach, that would create a huge cascade of changes. For example, astreamer_recovery_injector_content() passes mystreamer->recoveryconfcontents->data to astreamer_content() with recoveryconfcontents being a PQExpBuffer and: typedef struct PQExpBufferData { char *data; ... I'd vote for just changing the palloc() like proposed in v1. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com