3 ms·Malloc is O(n²) so it totally depend on how able you are to not do gradual allocation.by yxhuvud 10y agoMalloc is O(n²) so it totally depend on how able you are to not do gradual allocation.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.