Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

nodes.c

Blame
  • nodes.c 1.06 KiB
    /*-------------------------------------------------------------------------
     *
     * nodes.c
     *	  support code for nodes (now that we get rid of the home-brew
     *	  inheritance system, our support code for nodes get much simpler)
     *
     * Copyright (c) 1994, Regents of the University of California
     *
     *
     * IDENTIFICATION
     *	  $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.10 1999/07/17 20:17:07 momjian Exp $
     *
     * HISTORY
     *	  Andrew Yu			Oct 20, 1994	file creation
     *
     *-------------------------------------------------------------------------
     */
    #include "postgres.h"
    #include "nodes/nodes.h"
    
    /*
     * newNode -
     *	  create a new node of the specified size and tag the node with the
     *	  specified tag.
     *
     * !WARNING!: Avoid using newNode directly. You should be using the
     *	  macro makeNode. eg. to create a Resdom node, use makeNode(Resdom)
     *
     */
    Node *
    newNode(Size size, NodeTag tag)
    {
    	Node	   *newNode;
    
    	Assert(size >= 4);			/* need the tag, at least */
    
    	newNode = (Node *) palloc(size);
    	MemSet((char *) newNode, 0, size);
    	newNode->type = tag;
    	return newNode;
    }