blob: afc52b4b5b4e50ff795c2228568809e4bb8edc4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/*-------------------------------------------------------------------------
*
* palloc.c
* POSTGRES memory allocator code.
*
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/palloc.c,v 1.15 1999/10/23 03:13:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "nodes/memnodes.h"
/* ----------------------------------------------------------------
* User library functions
* ----------------------------------------------------------------
*/
/* ----------
* palloc(), pfree() and repalloc() are now macros in palloc.h
* ----------
*/
char *
pstrdup(char *string)
{
char *nstr;
int len;
nstr = palloc(len = strlen(string) + 1);
memcpy(nstr, string, len);
return nstr;
}
|