mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Add new palloc0 call as merge of palloc and MemSet(0).
This commit is contained in:
@@ -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.35 2002/11/11 03:02:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.36 2002/11/13 00:39:46 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -103,9 +103,7 @@ rt_poly_union(PG_FUNCTION_ARGS)
|
||||
POLYGON *b = PG_GETARG_POLYGON_P(1);
|
||||
POLYGON *p;
|
||||
|
||||
p = (POLYGON *) palloc(sizeof(POLYGON));
|
||||
|
||||
MemSet((char *) p, 0, sizeof(POLYGON)); /* zero any holes */
|
||||
p = (POLYGON *) palloc0(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);
|
||||
@@ -127,9 +125,7 @@ rt_poly_inter(PG_FUNCTION_ARGS)
|
||||
POLYGON *b = PG_GETARG_POLYGON_P(1);
|
||||
POLYGON *p;
|
||||
|
||||
p = (POLYGON *) palloc(sizeof(POLYGON));
|
||||
|
||||
MemSet((char *) p, 0, sizeof(POLYGON)); /* zero any holes */
|
||||
p = (POLYGON *) palloc0(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);
|
||||
|
||||
Reference in New Issue
Block a user