This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/29688] resize initializes whole array
- From: "theo dot bosman at net dot HCC dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Nov 2006 15:56:54 -0000
- Subject: [Bug libstdc++/29688] resize initializes whole array
- References: <bug-29688-13504@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from theo dot bosman at net dot HCC dot nl 2006-11-02 15:56 -------
Subject: Re: resize initializes whole array
There is no argument against the ISO standard, but to a non C/C++ programmer
it seems a waist of time to reallocate the array and initialize it when one
wants to add something to an array. Some other compilers will copy the
existing data into the newly allocated space which seems more in line with
the text book.
The application will be changed to avoid the loss of data on a resize of
arrays, which is a better idea anyway. Thanks for the speedy reply.
Theo Bosman
----- Original Message -----
From: "pcarlini at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: <theo.bosman@net.HCC.nl>
Sent: Thursday, November 02, 2006 2:51 PM
Subject: [Bug libstdc++/29688] resize initializes whole array
>
>
> ------- Comment #2 from pcarlini at suse dot de 2006-11-02 13:51 -------
> The only possible change I can see, as an optimization, is using
> __valarray_fill instead of __valarray_destroy_elements and
> __valarray_fill_construct, when _M_size == __n. Let's ask Gaby...
>
>
> --
>
> pcarlini at suse dot de changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |pcarlini at suse dot de,
> gdr
> | |at integrable-solutions
> dot
> | |net
> Status|RESOLVED |UNCONFIRMED
> Resolution|INVALID |
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29688
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29688