MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / alloc_chunk

Method alloc_chunk

KBotExt/imgui/imgui_internal.h:693–693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

691 bool empty() const { return Buf.Size == 0; }
692 int size() const { return Buf.Size; }
693 T* alloc_chunk(size_t sz) { size_t HDR_SZ = 4; sz = IM_MEMALIGN(HDR_SZ + sz, 4u); int off = Buf.Size; Buf.resize(off + (int)sz); ((int*)(void*)(Buf.Data + off))[0] = (int)sz; return (T*)(void*)(Buf.Data + off + (int)HDR_SZ); }
694 T* begin() { size_t HDR_SZ = 4; if (!Buf.Data) return NULL; return (T*)(void*)(Buf.Data + HDR_SZ); }
695 T* next_chunk(T* p) { size_t HDR_SZ = 4; IM_ASSERT(p >= begin() && p < end()); p = (T*)(void*)((char*)(void*)p + chunk_size(p)); if (p == (T*)(void*)((char*)end() + HDR_SZ)) return (T*)0; IM_ASSERT(p < end()); return p; }
696 int chunk_size(const T* p) { return ((const int*)p)[-1]; }

Callers 3

TableSettingsCreateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected