Firstly, I use a variant of segment tree, allow us to insert element and access elements by indexes. Each node will have two childs: Left[Node] and Right[Node], by default, they are 0 (NULL). To be indexable, we must maintain array Size[]. #include<stdio.h>#include<iostream>#inclu...
The allocation occurs in the topic_metadata_item::partitions map while adding a partition to the map in topic_table. The size makes sense: we have ~22,900 partitoins and assuming node hash map is an array of pointer-sized things (highly likely) we have 183K for that many elements: ass...