1
0
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:
Bruce Momjian
2002-11-10 07:25:14 +00:00
parent 78822b328c
commit 8fee9615cc
37 changed files with 107 additions and 210 deletions

View File

@@ -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;

View File

@@ -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;