Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Without a capacity field, each push operation potentially triggers a realloc, causing O(n) copying and possible memory fragmentation - especially problematic for large vectors or performance-critical code.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: