MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / __pool_index

Method __pool_index

system/lib/libcxx/src/memory_resource.cpp:282–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280int unsynchronized_pool_resource::__log2_pool_block_size(int i) const { return (i + __log2_smallest_block_size); }
281
282int unsynchronized_pool_resource::__pool_index(size_t bytes, size_t align) const {
283 if (align > alignof(std::max_align_t) || bytes > (size_t(1) << __num_fixed_pools_))
284 return __num_fixed_pools_;
285 else {
286 int i = 0;
287 bytes = (bytes > align) ? bytes : align;
288 bytes -= 1;
289 bytes >>= __log2_smallest_block_size;
290 while (bytes != 0) {
291 bytes >>= 1;
292 i += 1;
293 }
294 return i;
295 }
296}
297
298unsynchronized_pool_resource::unsynchronized_pool_resource(const pool_options& opts, memory_resource* upstream)
299 : __res_(upstream), __fixed_pools_(nullptr) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected