1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Back out use of palloc0 in place if palloc/MemSet. Seems constant len

to MemSet is a performance boost.
This commit is contained in:
Bruce Momjian
2002-11-11 03:02:20 +00:00
parent 5d283d89cb
commit 75fee4535d
38 changed files with 212 additions and 110 deletions

View File

@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.34 2002/11/10 07:25:13 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.35 2002/11/11 03:02:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -103,7 +103,9 @@ rt_poly_union(PG_FUNCTION_ARGS)
POLYGON *b = PG_GETARG_POLYGON_P(1);
POLYGON *p;
p = (POLYGON *) palloc0(sizeof(POLYGON)); /* zero any holes */
p = (POLYGON *) palloc(sizeof(POLYGON));
MemSet((char *) p, 0, sizeof(POLYGON)); /* zero any holes */
p->size = sizeof(POLYGON);
p->npts = 0;
p->boundbox.high.x = Max(a->boundbox.high.x, b->boundbox.high.x);
@@ -125,7 +127,9 @@ rt_poly_inter(PG_FUNCTION_ARGS)
POLYGON *b = PG_GETARG_POLYGON_P(1);
POLYGON *p;
p = (POLYGON *) palloc0(sizeof(POLYGON)); /* zero any holes */
p = (POLYGON *) palloc(sizeof(POLYGON));
MemSet((char *) p, 0, sizeof(POLYGON)); /* zero any holes */
p->size = sizeof(POLYGON);
p->npts = 0;
p->boundbox.high.x = Min(a->boundbox.high.x, b->boundbox.high.x);