mirror of
https://github.com/postgres/postgres.git
synced 2025-08-09 17:03:00 +03:00
Merge palloc()/MemSet(0) calls into a single palloc0() call.
This commit is contained in:
@@ -1442,8 +1442,7 @@ init_dblink_results(MemoryContext fn_mcxt)
|
||||
|
||||
oldcontext = MemoryContextSwitchTo(fn_mcxt);
|
||||
|
||||
retval = (dblink_results *) palloc(sizeof(dblink_results));
|
||||
MemSet(retval, 0, sizeof(dblink_results));
|
||||
retval = (dblink_results *) palloc0(sizeof(dblink_results));
|
||||
|
||||
retval->tup_num = -1;
|
||||
retval->res_id_index = -1;
|
||||
|
@@ -916,10 +916,8 @@ new_intArrayType(int num)
|
||||
ArrayType *r;
|
||||
int nbytes = ARR_OVERHEAD(NDIM) + sizeof(int) * num;
|
||||
|
||||
r = (ArrayType *) palloc(nbytes);
|
||||
r = (ArrayType *) palloc0(nbytes);
|
||||
|
||||
MemSet(r, 0, nbytes);
|
||||
|
||||
ARR_SIZE(r) = nbytes;
|
||||
ARR_NDIM(r) = NDIM;
|
||||
ARR_ELEMTYPE(r) = INT4OID;
|
||||
|
Reference in New Issue
Block a user