aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/geo_ops.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-11-11 03:02:20 +0000
committerBruce Momjian <bruce@momjian.us>2002-11-11 03:02:20 +0000
commit75fee4535d1a9741474b53bd46a3585ad3c66eb5 (patch)
treede4500a8b76fdb882f055ad7bd8889be9d51c790 /src/backend/utils/adt/geo_ops.c
parent5d283d89cb6142d721c095c28be19056ad620616 (diff)
downloadpostgresql-75fee4535d1a9741474b53bd46a3585ad3c66eb5.tar.gz
postgresql-75fee4535d1a9741474b53bd46a3585ad3c66eb5.zip
Back out use of palloc0 in place if palloc/MemSet. Seems constant len
to MemSet is a performance boost.
Diffstat (limited to 'src/backend/utils/adt/geo_ops.c')
-rw-r--r--src/backend/utils/adt/geo_ops.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index f39cfab1b11..a0ddd377238 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.69 2002/11/10 07:25:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.70 2002/11/11 03:02:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3130,8 +3130,9 @@ poly_in(PG_FUNCTION_ARGS)
elog(ERROR, "Bad polygon external representation '%s'", str);
size = offsetof(POLYGON, p[0]) +sizeof(poly->p[0]) * npts;
- poly = (POLYGON *) palloc0(size); /* zero any holes */
+ poly = (POLYGON *) palloc(size);
+ MemSet((char *) poly, 0, size); /* zero any holes */
poly->size = size;
poly->npts = npts;
@@ -4451,7 +4452,9 @@ circle_poly(PG_FUNCTION_ARGS)
if (base_size / npts != sizeof(poly->p[0]) || size <= base_size)
elog(ERROR, "too many points requested");
- poly = (POLYGON *) palloc0(size); /* zero any holes */
+ poly = (POLYGON *) palloc(size);
+
+ MemSet(poly, 0, size); /* zero any holes */
poly->size = size;
poly->npts = npts;