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_EXTERNAL_BASEBIT MEMORY_CONTEXT_METHODID_BITS |
#define | MEMORYCHUNK_VALUE_BASEBIT (MEMORYCHUNK_EXTERNAL_BASEBIT + 1) |
#define | MEMORYCHUNK_BLOCKOFFSET_BASEBIT (MEMORYCHUNK_VALUE_BASEBIT + 30) |
#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_MAX_BLOCKOFFSET) |
#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_MAX_BLOCKOFFSET) |
Definition at line 137 of file memutils_memorychunk.h.
#define HdrMaskCheckMagic | ( | hdrmask | ) |
Definition at line 141 of file memutils_memorychunk.h.
#define HdrMaskGetValue | ( | hdrmask | ) | (((hdrmask) >> MEMORYCHUNK_VALUE_BASEBIT) & MEMORYCHUNK_MAX_VALUE) |
Definition at line 130 of file memutils_memorychunk.h.
#define HdrMaskIsExternal | ( | hdrmask | ) | ((hdrmask) & (((uint64) 1) << MEMORYCHUNK_EXTERNAL_BASEBIT)) |
Definition at line 128 of file memutils_memorychunk.h.
#define MEMORYCHUNK_BLOCKOFFSET_BASEBIT (MEMORYCHUNK_VALUE_BASEBIT + 30) |
Definition at line 99 of file memutils_memorychunk.h.
#define MEMORYCHUNK_EXTERNAL_BASEBIT MEMORY_CONTEXT_METHODID_BITS |
Definition at line 97 of file memutils_memorychunk.h.
#define MEMORYCHUNK_MAGIC |
Definition at line 106 of file memutils_memorychunk.h.
#define MEMORYCHUNK_MAX_BLOCKOFFSET UINT64CONST(0x3FFFFFFF) |
Definition at line 94 of file memutils_memorychunk.h.
#define MEMORYCHUNK_MAX_VALUE UINT64CONST(0x3FFFFFFF) |
Definition at line 88 of file memutils_memorychunk.h.
#define MEMORYCHUNK_VALUE_BASEBIT (MEMORYCHUNK_EXTERNAL_BASEBIT + 1) |
Definition at line 98 of file memutils_memorychunk.h.
#define MemoryChunkGetPointer | ( | c | ) | ((void *) ((char *) (c) + sizeof(MemoryChunk))) |
Definition at line 124 of file memutils_memorychunk.h.
#define PointerGetMemoryChunk | ( | p | ) | ((MemoryChunk *) ((char *) (p) - sizeof(MemoryChunk))) |
Definition at line 121 of file memutils_memorychunk.h.
typedef struct MemoryChunk MemoryChunk |
|
inlinestatic |
Definition at line 220 of file memutils_memorychunk.h.
References Assert(), MemoryChunk::hdrmask, HdrMaskBlockOffset, and HdrMaskIsExternal.
Referenced by AlignedAllocFree(), AlignedAllocGetChunkContext(), AlignedAllocGetChunkSpace(), AlignedAllocRealloc(), AllocSetFree(), AllocSetGetChunkContext(), AllocSetRealloc(), GenerationFree(), GenerationGetChunkContext(), GenerationRealloc(), SlabFree(), SlabGetChunkContext(), SlabGetChunkSpace(), and SlabRealloc().
|
inlinestatic |
Definition at line 207 of file memutils_memorychunk.h.
References Assert(), MemoryChunk::hdrmask, HdrMaskGetValue, and HdrMaskIsExternal.
Referenced by AlignedAllocRealloc(), AllocSetAlloc(), AllocSetFree(), AllocSetGetChunkSpace(), AllocSetRealloc(), AllocSetStats(), GenerationFree(), GenerationGetChunkSpace(), and GenerationRealloc().
|
inlinestatic |
Definition at line 189 of file memutils_memorychunk.h.
References Assert(), MemoryChunk::hdrmask, HdrMaskCheckMagic, and HdrMaskIsExternal.
Referenced by AlignedAllocFree(), AlignedAllocGetChunkContext(), AllocSetFree(), AllocSetGetChunkContext(), AllocSetGetChunkSpace(), AllocSetRealloc(), GenerationFree(), GenerationGetChunkContext(), GenerationGetChunkSpace(), and GenerationRealloc().
|
inlinestatic |
Definition at line 154 of file memutils_memorychunk.h.
References Assert(), MemoryChunk::hdrmask, MEMORY_CONTEXT_METHODID_MASK, MEMORYCHUNK_BLOCKOFFSET_BASEBIT, MEMORYCHUNK_MAX_BLOCKOFFSET, MEMORYCHUNK_MAX_VALUE, MEMORYCHUNK_VALUE_BASEBIT, and value.
Referenced by AllocSetAlloc(), GenerationAlloc(), MemoryContextAllocAligned(), and SlabAlloc().
|
inlinestatic |
Definition at line 175 of file memutils_memorychunk.h.
References Assert(), MemoryChunk::hdrmask, MEMORY_CONTEXT_METHODID_MASK, MEMORYCHUNK_EXTERNAL_BASEBIT, and MEMORYCHUNK_MAGIC.
Referenced by AllocSetAlloc(), and GenerationAlloc().