Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
_4r6j
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
_4r6j
5y ago
I believe you are talking about *ptr = T(std::forward<Args>(args)...) That's an rvalue ref so std::move is superfluous. Not an assign
2.
▲
by
_4r6j
5y ago
Someone added one for me https://github.com/keur/virtual_vec/pull/1 :)
3.
▲
by
_4r6j
5y ago
Yeah i verified the same thing on Linux. I will update the README with that.
4.
▲
by
_4r6j
5y ago
iterating over vectors (of trivial types that aren't pointers) is generally going to be faster since the memory is contiguous. deque is implemented with chunks i believe? loading in new chunk could be cache eviction.
5.
▲
by
_4r6j
5y ago
yeah it's not any better in that case then. i updated README to reflect that.
6.
▲
by
_4r6j
5y ago
good catch will update
7.
▲
by
_4r6j
5y ago
That will actually allocate 4GB to your process, EDIT: OS dependent. This just reserves 4GB of virtual memory addresses.
8.
▲
by
_4r6j
5y ago
If you know the size of your data upfront this isn't applicable. Usually I use std::vector when I don't know how much data I have. If you already know the size why not avoid allocating on the heap altogether? I will update the REA
9.
▲
Show HN: C++ virtual_vec vector implementation
(github.com)
39 points
by
_4r6j
5y ago
|
53 comments