Skip to content

Commit 86c2ead

Browse files
committed
Modify mcxt.h so that it doesn't pull in half of creation.
1 parent dffb88b commit 86c2ead

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

src/backend/utils/hash/dynahash.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.20 1999/03/06 21:17:56 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.21 1999/03/07 23:03:32 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -49,6 +49,7 @@
4949
#include "utils/mcxt.h"
5050
#endif /* !FRONTEND */
5151
#include "utils/palloc.h"
52+
#include "utils/memutils.h"
5253

5354
/*
5455
* Fast arithmetic, relying on powers of 2,

src/include/nodes/memnodes.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: memnodes.h,v 1.10 1999/02/13 23:21:38 momjian Exp $
9+
* $Id: memnodes.h,v 1.11 1999/03/07 23:03:31 tgl Exp $
1010
*
1111
* XXX the typedefs in this file are different from the other ???nodes.h;
1212
* they are pointers to structures instead of the structures themselves.
@@ -60,7 +60,9 @@ typedef struct MemoryContextData
6060
{
6161
NodeTag type;
6262
MemoryContextMethods method;
63-
} *MemoryContext;
63+
} MemoryContextData;
64+
65+
/* utils/mcxt.h contains typedef struct MemoryContextData *MemoryContext */
6466

6567
/* think about doing this right some time but we'll have explicit fields
6668
for now -ay 10/94 */
@@ -71,9 +73,11 @@ typedef struct GlobalMemoryData
7173
AllocSetData setData;
7274
char *name;
7375
OrderedElemData elemData;
74-
} *GlobalMemory;
76+
} GlobalMemoryData;
77+
78+
/* utils/mcxt.h contains typedef struct GlobalMemoryData *GlobalMemory */
7579

76-
typedef MemoryContext *PortalMemoryContext;
80+
typedef struct MemoryContextData *PortalMemoryContext;
7781

7882
typedef struct PortalVariableMemoryData
7983
{

src/include/utils/mcxt.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: mcxt.h,v 1.12 1999/02/13 23:22:24 momjian Exp $
9+
* $Id: mcxt.h,v 1.13 1999/03/07 23:03:31 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
1313
#ifndef MCXT_H
1414
#define MCXT_H
1515

16-
#include <nodes/memnodes.h>
16+
/* These types are declared in nodes/memnodes.h, but most users of memory
17+
* allocation should just treat them as abstract types, so we do not provide
18+
* the struct contents here.
19+
*/
20+
21+
typedef struct MemoryContextData *MemoryContext;
22+
typedef struct GlobalMemoryData *GlobalMemory;
23+
1724

1825
extern MemoryContext CurrentMemoryContext;
1926
extern MemoryContext TopMemoryContext;

0 commit comments

Comments
 (0)