This is the mail archive of the
mailing list for the GCC project.
Re: libstdc++ deque allocation
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Soul Studios <matt at soulstudios dot co dot nz>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 23 Jun 2016 10:12:04 +0100
- Subject: Re: libstdc++ deque allocation
- Authentication-results: sourceware.org; auth=none
- References: <576B28F4 dot 3030309 at soulstudios dot co dot nz>
On 23 June 2016 at 01:10, Soul Studios wrote:
> Hi there-
> quick question,
It would have been better on the libstdc++ mailing list.
> does deque as defined in libstdc++ allocate upon initialisation or upon
> first insertion?
Unfortunately our std::deque allocates some memory in its default
constructor (and in move constructors and move assignment operators).
> Trying to dig through the code but can't figure it out.
> Reason being, it's insertion graphs seem to show a surprisingly linear
> progression from small amounts of N to large amounts.
> Thanks in advance,