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

Function bms_make_singleton

src/backend/nodes/bitmapset.c:182–197  ·  view source on GitHub ↗

* bms_make_singleton - build a bitmapset containing a single member */

Source from the content-addressed store, hash-verified

180 * bms_make_singleton - build a bitmapset containing a single member
181 */
182Bitmapset *
183bms_make_singleton(int x)
184{
185 Bitmapset *result;
186 int wordnum,
187 bitnum;
188
189 if (x < 0)
190 elog(ERROR, "negative bitmapset member not allowed");
191 wordnum = WORDNUM(x);
192 bitnum = BITNUM(x);
193 result = (Bitmapset *) palloc0(BITMAPSET_SIZE(wordnum + 1));
194 result->nwords = wordnum + 1;
195 result->words[wordnum] = ((bitmapword) 1 << bitnum);
196 return result;
197}
198
199/*
200 * bms_free - free a bitmapset

Callers 15

deparseReturningListFunction · 0.85
load_enum_cache_dataFunction · 0.85
CpusetToBitsetFunction · 0.85
test_BitsetToCpusetFunction · 0.85
pg_column_is_updatableFunction · 0.85
ATExecDropColumnFunction · 0.85
ATPrepAlterColumnTypeFunction · 0.85
DiscreteKnapsackFunction · 0.85
bms_add_memberFunction · 0.85

Calls 1

palloc0Function · 0.50

Tested by 2

test_BitsetToCpusetFunction · 0.68