MCPcopy Create free account
hub / github.com/apache/cloudberry / GetMemoryChunkContext

Function GetMemoryChunkContext

src/include/utils/memutils.h:162–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160 */
161#ifndef FRONTEND
162static inline MemoryContext
163GetMemoryChunkContext(void *pointer)
164{
165 MemoryContext context;
166
167 /*
168 * Try to detect bogus pointers handed to us, poorly though we can.
169 * Presumably, a pointer that isn't MAXALIGNED isn't pointing at an
170 * allocated chunk.
171 */
172 Assert(pointer != NULL);
173 Assert(pointer == (void *) MAXALIGN(pointer));
174
175 /*
176 * OK, it's probably safe to look at the context.
177 */
178 context = *(MemoryContext *) (((char *) pointer) - sizeof(void *));
179
180 AssertArg(MemoryContextIsValid(context));
181
182 return context;
183}
184#endif
185
186/*

Callers 15

GetMemoryChunkSpaceFunction · 0.85
pfreeFunction · 0.85
repallocFunction · 0.85
repalloc_hugeFunction · 0.85
ATExecExpandTableFunction · 0.85
ATExecSetDistributedByFunction · 0.85
enlarge_listFunction · 0.85
list_delete_nth_cellFunction · 0.85
list_delete_first_nFunction · 0.85
mark_dummy_relFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected