2 ms·In most C libraries malloc() is O(log n), e.g. when implemented as balanced trees.by faragon 10y agoIn most C libraries malloc() is O(log n), e.g. when implemented as balanced trees.yxhuvud 10y agoArgh. True, sorry for the brainfart.