mirror of
https://github.com/postgres/postgres.git
synced 2025-11-15 03:41:20 +03:00
Merge palloc()/MemSet(0) calls into a single palloc0() call.
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.66 2002/08/06 19:41:23 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.67 2002/11/10 07:25:13 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -111,9 +111,7 @@ static void _bt_load(Relation index, BTSpool *btspool, BTSpool *btspool2);
|
||||
BTSpool *
|
||||
_bt_spoolinit(Relation index, bool isunique)
|
||||
{
|
||||
BTSpool *btspool = (BTSpool *) palloc(sizeof(BTSpool));
|
||||
|
||||
MemSet((char *) btspool, 0, sizeof(BTSpool));
|
||||
BTSpool *btspool = (BTSpool *) palloc0(sizeof(BTSpool));
|
||||
|
||||
btspool->index = index;
|
||||
btspool->isunique = isunique;
|
||||
@@ -207,9 +205,7 @@ _bt_blnewpage(Relation index, Buffer *buf, Page *page, int flags)
|
||||
static BTPageState *
|
||||
_bt_pagestate(Relation index, int flags, int level)
|
||||
{
|
||||
BTPageState *state = (BTPageState *) palloc(sizeof(BTPageState));
|
||||
|
||||
MemSet((char *) state, 0, sizeof(BTPageState));
|
||||
BTPageState *state = (BTPageState *) palloc0(sizeof(BTPageState));
|
||||
|
||||
/* create initial page */
|
||||
_bt_blnewpage(index, &(state->btps_buf), &(state->btps_page), flags);
|
||||
|
||||
Reference in New Issue
Block a user