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

Function _bitmap_free_tidbuf

src/backend/access/bitmap/bitmapinsert.c:2101–2120  ·  view source on GitHub ↗

* _bitmap_free_tidbuf() -- release the space. */

Source from the content-addressed store, hash-verified

2099 * _bitmap_free_tidbuf() -- release the space.
2100 */
2101static uint16
2102_bitmap_free_tidbuf(BMTIDBuffer* buf)
2103{
2104 uint16 bytes_freed = 0;
2105
2106 if (buf->last_tids)
2107 pfree(buf->last_tids);
2108 if (buf->cwords)
2109 pfree(buf->cwords);
2110
2111 bytes_freed = buf->num_cwords * sizeof(BM_HRL_WORD) +
2112 buf->num_cwords * sizeof(uint64);
2113
2114 buf->num_cwords = 0;
2115 buf->curword = 0;
2116 /* Paranoia */
2117 MemSet(buf->hwords, 0, sizeof(BM_HRL_WORD) * BM_NUM_OF_HEADER_WORDS);
2118
2119 return bytes_freed;
2120}
2121
2122/*
2123 * insertsetbit() -- insert a given set bit into a bitmap

Callers 5

updatesetbitFunction · 0.85
updatesetbit_inpageFunction · 0.85
buf_add_tidFunction · 0.85
buf_free_mem_blockFunction · 0.85
inserttupleFunction · 0.85

Calls 1

pfreeFunction · 0.50

Tested by

no test coverage detected