mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +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:
@@ -35,7 +35,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.67 2002/11/10 07:25:13 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.68 2002/11/11 03:02:18 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -111,7 +111,9 @@ static void _bt_load(Relation index, BTSpool *btspool, BTSpool *btspool2);
|
||||
BTSpool *
|
||||
_bt_spoolinit(Relation index, bool isunique)
|
||||
{
|
||||
BTSpool *btspool = (BTSpool *) palloc0(sizeof(BTSpool));
|
||||
BTSpool *btspool = (BTSpool *) palloc(sizeof(BTSpool));
|
||||
|
||||
MemSet((char *) btspool, 0, sizeof(BTSpool));
|
||||
|
||||
btspool->index = index;
|
||||
btspool->isunique = isunique;
|
||||
@@ -205,7 +207,9 @@ _bt_blnewpage(Relation index, Buffer *buf, Page *page, int flags)
|
||||
static BTPageState *
|
||||
_bt_pagestate(Relation index, int flags, int level)
|
||||
{
|
||||
BTPageState *state = (BTPageState *) palloc0(sizeof(BTPageState));
|
||||
BTPageState *state = (BTPageState *) palloc(sizeof(BTPageState));
|
||||
|
||||
MemSet((char *) state, 0, sizeof(BTPageState));
|
||||
|
||||
/* create initial page */
|
||||
_bt_blnewpage(index, &(state->btps_buf), &(state->btps_page), flags);
|
||||
|
||||
Reference in New Issue
Block a user