PostgreSQL Source Code
git master
|
#include "utils/memutils_internal.h"
Go to the source code of this file.
Data Structures | |
struct | MemoryChunk |
Macros | |
#define | MEMORYCHUNK_MAX_VALUE UINT64CONST(0x3FFFFFFF) |
#define | MEMORYCHUNK_MAX_BLOCKOFFSET UINT64CONST(0x3FFFFFFF) |
#define | MEMORYCHUNK_BLOCKOFFSET_MASK UINT64CONST(0x3FFFFFFE) |
#define | MEMORYCHUNK_EXTERNAL_BASEBIT MEMORY_CONTEXT_METHODID_BITS |
#define | MEMORYCHUNK_VALUE_BASEBIT (MEMORYCHUNK_EXTERNAL_BASEBIT + 1) |
#define | MEMORYCHUNK_BLOCKOFFSET_BASEBIT (MEMORYCHUNK_VALUE_BASEBIT + 29) |
#define | MEMORYCHUNK_MAGIC |
#define | PointerGetMemoryChunk(p) ((MemoryChunk *) ((char *) (p) - sizeof(MemoryChunk))) |
#define | MemoryChunkGetPointer(c) ((void *) ((char *) (c) + sizeof(MemoryChunk))) |
#define | HdrMaskIsExternal(hdrmask) ((hdrmask) & (((uint64) 1) << MEMORYCHUNK_EXTERNAL_BASEBIT)) |
#define | HdrMaskGetValue(hdrmask) (((hdrmask) >> MEMORYCHUNK_VALUE_BASEBIT) & MEMORYCHUNK_MAX_VALUE) |
#define | HdrMaskBlockOffset(hdrmask) (((hdrmask) >> MEMORYCHUNK_BLOCKOFFSET_BASEBIT) & MEMORYCHUNK_BLOCKOFFSET_MASK) |
#define | HdrMaskCheckMagic(hdrmask) |
Typedefs | |
typedef struct MemoryChunk | MemoryChunk |
Functions | |
static void | MemoryChunkSetHdrMask (MemoryChunk *chunk, void *block, Size value, MemoryContextMethodID methodid) |
static void | MemoryChunkSetHdrMaskExternal (MemoryChunk *chunk, MemoryContextMethodID methodid) |
static bool | MemoryChunkIsExternal (MemoryChunk *chunk) |
static Size | MemoryChunkGetValue (MemoryChunk *chunk) |
static void * | MemoryChunkGetBlock (MemoryChunk *chunk) |
#define HdrMaskBlockOffset | ( | hdrmask | ) | (((hdrmask) >> MEMORYCHUNK_BLOCKOFFSET_BASEBIT) & MEMORYCHUNK_BLOCKOFFSET_MASK) |
Definition at line 151 of file memutils_memorychunk.h.
#define HdrMaskCheckMagic | ( | hdrmask | ) |
Definition at line 155 of file memutils_memorychunk.h.
#define HdrMaskGetValue | ( | hdrmask | ) | (((hdrmask) >> MEMORYCHUNK_VALUE_BASEBIT) & MEMORYCHUNK_MAX_VALUE) |
Definition at line 144 of file memutils_memorychunk.h.
#define HdrMaskIsExternal | ( | hdrmask | ) | ((hdrmask) & (((uint64) 1) << MEMORYCHUNK_EXTERNAL_BASEBIT)) |
Definition at line 142 of file memutils_memorychunk.h.
#define MEMORYCHUNK_BLOCKOFFSET_BASEBIT (MEMORYCHUNK_VALUE_BASEBIT + 29) |
Definition at line 113 of file memutils_memorychunk.h.
#define MEMORYCHUNK_BLOCKOFFSET_MASK UINT64CONST(0x3FFFFFFE) |
Definition at line 108 of file memutils_memorychunk.h.
#define MEMORYCHUNK_EXTERNAL_BASEBIT MEMORY_CONTEXT_METHODID_BITS |
Definition at line 111 of file memutils_memorychunk.h.
#define MEMORYCHUNK_MAGIC |
Definition at line 120 of file memutils_memorychunk.h.
#define MEMORYCHUNK_MAX_BLOCKOFFSET UINT64CONST(0x3FFFFFFF) |
Definition at line 102 of file memutils_memorychunk.h.
#define MEMORYCHUNK_MAX_VALUE UINT64CONST(0x3FFFFFFF) |
Definition at line 96 of file memutils_memorychunk.h.
#define MEMORYCHUNK_VALUE_BASEBIT (MEMORYCHUNK_EXTERNAL_BASEBIT + 1) |
Definition at line 112 of file memutils_memorychunk.h.
#define MemoryChunkGetPointer | ( | c | ) | ((void *) ((char *) (c) + sizeof(MemoryChunk))) |
Definition at line 138 of file memutils_memorychunk.h.
#define PointerGetMemoryChunk | ( | p | ) | ((MemoryChunk *) ((char *) (p) - sizeof(MemoryChunk))) |
Definition at line 135 of file memutils_memorychunk.h.
typedef struct MemoryChunk MemoryChunk |
|
inlinestatic |
Definition at line 235 of file memutils_memorychunk.h.
References Assert, chunk, HdrMaskBlockOffset, and HdrMaskIsExternal.
Referenced by AlignedAllocFree(), AlignedAllocGetChunkContext(), AlignedAllocGetChunkSpace(), AlignedAllocRealloc(), AllocSetFree(), AllocSetGetChunkContext(), AllocSetRealloc(), GenerationFree(), GenerationGetChunkContext(), GenerationRealloc(), SlabFree(), SlabGetChunkContext(), SlabGetChunkSpace(), and SlabRealloc().
|
inlinestatic |
Definition at line 222 of file memutils_memorychunk.h.
References Assert, chunk, HdrMaskGetValue, and HdrMaskIsExternal.
Referenced by AlignedAllocRealloc(), AllocSetAlloc(), AllocSetFree(), AllocSetGetChunkSpace(), AllocSetRealloc(), AllocSetStats(), GenerationFree(), GenerationGetChunkSpace(), and GenerationRealloc().
|
inlinestatic |
Definition at line 204 of file memutils_memorychunk.h.
References Assert, chunk, HdrMaskCheckMagic, and HdrMaskIsExternal.
Referenced by AlignedAllocFree(), AlignedAllocGetChunkContext(), AllocSetFree(), AllocSetGetChunkContext(), AllocSetGetChunkSpace(), AllocSetRealloc(), GenerationFree(), GenerationGetChunkContext(), GenerationGetChunkSpace(), and GenerationRealloc().
|
inlinestatic |
Definition at line 169 of file memutils_memorychunk.h.
References Assert, chunk, MEMORY_CONTEXT_METHODID_MASK, MEMORYCHUNK_BLOCKOFFSET_BASEBIT, MEMORYCHUNK_BLOCKOFFSET_MASK, MEMORYCHUNK_MAX_VALUE, MEMORYCHUNK_VALUE_BASEBIT, and value.
Referenced by AllocSetAllocChunkFromBlock(), AllocSetAllocFromNewBlock(), BumpAllocChunkFromBlock(), GenerationAllocChunkFromBlock(), MemoryContextAllocAligned(), and SlabAllocSetupNewChunk().
|
inlinestatic |
Definition at line 190 of file memutils_memorychunk.h.
References Assert, chunk, MEMORY_CONTEXT_METHODID_MASK, MEMORYCHUNK_EXTERNAL_BASEBIT, and MEMORYCHUNK_MAGIC.
Referenced by AllocSetAllocLarge(), BumpAllocLarge(), and GenerationAllocLarge().