Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #80243 > unrolled thread

Why does vector::reserve() not grow exponentially ?

Started byBonita Montero <Bonita.Montero@gmail.com>
First post2021-06-10 12:18 +0200
Last post2021-06-11 17:06 +0200
Articles 20 on this page of 252 — 51 participants

Back to article view | Back to comp.lang.c++


Contents

  Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-10 12:18 +0200
    Re: Why does vector::reserve() not grow exponentially ? Bo Persson <bo@bo-persson.se> - 2021-06-10 13:21 +0200
    Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-10 14:37 +0300
      Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-10 15:44 +0200
        Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-10 16:39 +0200
          Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-10 16:47 +0200
            Re: Why does vector::reserve() not grow exponentially ? Bo Persson <bo@bo-persson.se> - 2021-06-10 22:00 +0200
              Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-10 22:09 +0200
                Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-11 06:57 -0400
                  Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-11 13:16 +0200
                    Re: Why does vector::reserve() not grow exponentially ? Bo Persson <bo@bo-persson.se> - 2021-06-11 13:27 +0200
                      Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-11 13:53 +0200
                        Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-11 19:12 -0400
                          Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 04:09 +0200
                            Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-12 08:50 -0400
                              Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 15:43 +0200
                                Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-12 18:59 -0400
                                  Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-13 07:31 +0200
                                    Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-13 08:09 -0400
                                      Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-13 14:12 +0200
                                        Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-13 09:50 -0400
                                          Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-13 16:05 +0200
                                            Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-13 11:23 -0400
                                              Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-13 18:56 +0200
                                                Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-13 13:37 -0400
                                                  Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-14 05:16 +0200
                                                    Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-14 07:00 -0400
                                  Re: Why does vector::reserve() not grow exponentially MrSpook_t0Y6kgpd5@3dryi7no.gov - 2021-06-13 08:39 +0000
                    Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-11 19:11 -0400
                      Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 04:10 +0200
                        Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-11 22:18 -0700
                          Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 08:18 +0200
                            Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-12 01:43 -0700
                              Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 11:00 +0200
                                Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-12 02:04 -0700
                                  Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 11:15 +0200
                                    Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-12 02:24 -0700
                                      Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 11:30 +0200
                                        Re: Why does vector::reserve() not grow exponentially ? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2021-06-12 12:59 +0200
                                          Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 13:27 +0200
                                          Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 13:19 +0200
                                            Re: Why does vector::reserve() not grow exponentially ? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2021-06-12 13:30 +0200
                                              Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 13:39 +0200
                                            Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-12 14:04 +0200
                                              Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 15:30 +0200
                                        Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-12 08:53 -0400
                                          Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 15:31 +0200
                                            Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-12 18:43 -0400
                                              Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-13 07:31 +0200
                                                Re: Why does vector::reserve() not grow exponentially ? Richard Damon <Richard@Damon-Family.org> - 2021-06-13 07:48 -0400
                                                  Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-13 14:03 +0200
                                                    Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-13 14:12 +0200
                                                      Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-13 11:21 -0400
                                                        Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-13 18:55 +0200
                                                          Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-13 13:38 -0400
                                                            Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-14 05:18 +0200
                                                              Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-14 07:00 -0400
                                                                Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-14 13:08 +0200
                                                                  Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-14 18:35 -0400
                                                                    Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-14 22:49 -0700
                                                                      Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-15 08:11 -0400
                                                                        Re: Why does vector::reserve() not grow exponentially MrSpook_ka1o_g@otuej9sdvqn8a4.gov.uk - 2021-06-15 12:54 +0000
                                                                          Re: Why does vector::reserve() not grow exponentially "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-15 13:09 -0700
                                                                            Re: Why does vector::reserve() not grow exponentially MrSpook_b1My5@751smt.edu - 2021-06-16 08:44 +0000
                                                                              Re: Why does vector::reserve() not grow exponentially Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-16 13:11 +0300
                                                                                Re: Why does vector::reserve() not grow exponentially MrSpook_p6g@ktmy0vg8lj7jxt.biz - 2021-06-16 10:21 +0000
                                                                                  Re: Why does vector::reserve() not grow exponentially Sam <sam@email-scan.com> - 2021-06-16 06:41 -0400
                                                                                    Re: Why does vector::reserve() not grow exponentially MrSpook_F2ryro5_b@ugk_rvxkkm.gov - 2021-06-16 11:11 +0000
                                                                                      Re: Why does vector::reserve() not grow exponentially Sam <sam@email-scan.com> - 2021-06-16 08:25 -0400
                                                                                        Re: Why does vector::reserve() not grow exponentially Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-16 16:10 +0300
                                                                                        Re: Why does vector::reserve() not grow exponentially David Brown <david.brown@hesbynett.no> - 2021-06-16 15:59 +0200
                                                                                        Re: Why does vector::reserve() not grow exponentially MrSpook_ucGx3e4l@x8gqtuqjwl9z3g.com - 2021-06-16 13:47 +0000
                                                                                      Re: Why does vector::reserve() not grow exponentially scott@slp53.sl.home (Scott Lurndal) - 2021-06-16 15:09 +0000
                                                                                        Re: Why does vector::reserve() not grow exponentially Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-16 17:50 +0200
                                                                                        Re: Why does vector::reserve() not grow exponentially MrSpook_hjesjs@8pot25r5sg1xe.info - 2021-06-16 15:45 +0000
                                                                                          Re: Why does vector::reserve() not grow exponentially Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-16 21:08 +0300
                                                                                            Re: Why does vector::reserve() not grow exponentially scott@slp53.sl.home (Scott Lurndal) - 2021-06-16 19:06 +0000
                                                                                    Re: Why does vector::reserve() not grow exponentially Juha Nieminen <nospam@thanks.invalid> - 2021-06-16 13:09 +0000
                                                                      Re: Why does vector::reserve() not grow exponentially ? Manfred <noname@add.invalid> - 2021-06-15 20:30 +0200
                                                                      Re: Why does vector::reserve() not grow exponentially ? Juha Nieminen <nospam@thanks.invalid> - 2021-06-16 04:33 +0000
                                                                        Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-16 10:35 +0200
                                                                          Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-16 11:18 +0200
                                                                            Re: Why does vector::reserve() not grow exponentially ? MrSpook_u_kch7_3@abbbp5z5c0iw8rwgxg4.gov - 2021-06-16 09:34 +0000
                                                                              Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-16 11:53 +0200
                                                                                Re: Why does vector::reserve() not grow exponentially ? MrSpook_ge@ldwlviy1f9uwd19thc.gov - 2021-06-16 10:19 +0000
                                                                                  Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-16 13:09 +0200
                                                                          Re: Why does vector::reserve() not grow exponentially ? MrSpook_3_fdyox@sg5nvjmv741xbigdp6.info - 2021-06-16 09:04 +0000
                                                                            Re: Why does vector::reserve() not grow exponentially ? Juha Nieminen <nospam@thanks.invalid> - 2021-06-16 09:20 +0000
                                                                          Re: Why does vector::reserve() not grow exponentially ? Tim Woodall <news001@woodall.me.uk> - 2021-06-16 09:49 +0000
                                                                            Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-16 13:14 +0200
                                                                              Re: Why does vector::reserve() not grow exponentially ? MrSpook_G1Sw6pdcqz@5a69.edu - 2021-06-16 11:25 +0000
                                                                                Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-16 14:43 +0200
                                                                                  Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-16 14:44 +0200
                                                                                    Re: Why does vector::reserve() not grow exponentially ? MrSpook_g3w@2ur2yrijxtw7d3jt394yu9dp.org - 2021-06-16 13:48 +0000
                                                                                      Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-16 16:07 +0200
                                                                                  Re: Why does vector::reserve() not grow exponentially ? MrSpook_74D@ov88_wt8h.co.uk - 2021-06-16 13:54 +0000
                                                                                    Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-16 19:55 +0200
                                                                              Re: Why does vector::reserve() not grow exponentially ? Juha Nieminen <nospam@thanks.invalid> - 2021-06-16 13:14 +0000
                                                                              Re: Why does vector::reserve() not grow exponentially ? James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-06-16 10:38 -0400
                                                                                Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-16 19:58 +0200
                                                                          Re: Why does vector::reserve() not grow exponentially ? "daniel...@gmail.com" <danielaparker@gmail.com> - 2021-06-17 13:45 -0700
                                                                            Re: Why does vector::reserve() not grow exponentially ? Real Troll <real.troll@trolls.com> - 2021-06-17 21:15 +0000
                                                                              Re: Why does vector::reserve() not grow exponentially ? Manfred <noname@add.invalid> - 2021-06-18 15:23 +0200
                                                                            Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-18 08:56 +0200
                                                                              Re: Why does vector::reserve() not grow exponentially ? "daniel...@gmail.com" <danielaparker@gmail.com> - 2021-06-18 08:06 -0700
                                                                                Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-18 17:41 +0200
                                                                                  Re: Why does vector::reserve() not grow exponentially ? "daniel...@gmail.com" <danielaparker@gmail.com> - 2021-06-18 14:31 -0700
                                                                                    Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-19 02:53 -0700
                                                                                  Re: Why does vector::reserve() not grow exponentially ? Ian Collins <ian-news@hotmail.com> - 2021-06-19 11:10 +1200
                                                                                Re: Why does vector::reserve() not grow exponentially ? MrSpook_gavL@es9w71p.tv - 2021-06-18 15:53 +0000
                                                                                  Re: Why does vector::reserve() not grow exponentially ? scott@slp53.sl.home (Scott Lurndal) - 2021-06-18 16:06 +0000
                                                                            Re: Why does vector::reserve() not grow exponentially ? MrSpook_Zp_@opm5ve6jyhq.ac.uk - 2021-06-18 09:22 +0000
                                                                        Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-16 04:55 -0700
                                                                          Re: Why does vector::reserve() not grow exponentially ? Juha Nieminen <nospam@thanks.invalid> - 2021-06-16 13:16 +0000
                                                                            Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-16 11:03 -0700
                                                                              Re: Why does vector::reserve() not grow exponentially ? Juha Nieminen <nospam@thanks.invalid> - 2021-06-17 05:35 +0000
                                                                                Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-17 16:51 -0700
                                                                                  Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-17 20:19 -0400
                                                                                    Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-17 18:22 -0700
                                                                                      Re: Why does vector::reserve() not grow exponentially ? MrSpook_6a2az@yxcggolr9p.com - 2021-06-18 09:24 +0000
                                                                                        Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-18 08:20 -0400
                                                                                          Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-18 15:38 +0200
                                                                                            Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-18 18:01 -0400
                                                                                              Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-19 12:32 +0200
                                                                                                Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-19 09:12 -0400
                                                                                                  Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-19 15:24 +0200
                                                                                                    Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-19 17:33 -0400
                                                                                                      Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-20 09:45 +0200
                                                                                              Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-19 03:33 -0700
                                                                                                Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-19 09:38 -0400
                                                                                                  Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-19 12:50 -0700
                                                                                                    Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-19 17:46 -0400
                                                                                                      Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-20 05:19 -0700
                                                                                                  Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-19 23:27 +0300
                                                                                                    Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-19 17:50 -0400
                                                                                                  Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-19 16:44 -0700
                                                                                          Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-18 17:46 +0300
                                                                                            Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-18 17:41 -0400
                                                                                              Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-19 11:21 +0300
                                                                                                Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-19 09:08 -0400
                                                                                                  Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-20 21:09 +0300
                                                                                                    Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-20 11:59 -0700
                                                                                                    Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-20 22:02 +0300
                                                                                                    Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-20 14:56 -0700
                                                                                                      Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-21 09:22 +0300
                                                                                                        Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-21 16:46 -0700
                                                                                                          Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-22 10:56 +0300
                                                                                                            Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-22 12:49 -0700
                                                                                                              Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-23 01:36 +0300
                                                                                                                Re: Why does vector::reserve() not grow exponentially ? scott@slp53.sl.home (Scott Lurndal) - 2021-06-23 14:32 +0000
                                                                                                                  Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-23 16:55 +0200
                                                                                                                  Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-24 16:13 -0700
                                                                                                                    Re: Why does vector::reserve() not grow exponentially ? scott@slp53.sl.home (Scott Lurndal) - 2021-06-25 14:34 +0000
                                                                                                                      Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-25 12:16 -0700
                                                                                                              Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-22 15:36 -0700
                                                                                                                Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-24 16:09 -0700
                                                                                                        Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-21 17:12 -0700
                                                                                                    Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-20 19:03 -0400
                                                                                                      Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-21 09:52 +0300
                                                                                  Re: Why does vector::reserve() not grow exponentially ? red floyd <no.spam.here@its.invalid> - 2021-06-18 00:18 -0700
                                                                                    Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-18 02:06 -0700
                                                                                      Re: Why does vector::reserve() not grow exponentially ? Juha Nieminen <nospam@thanks.invalid> - 2021-06-21 12:43 +0000
                                                                                        Re: Why does vector::reserve() not grow exponentially ? Chris Vine <chris@cvine--nospam--.freeserve.co.uk> - 2021-06-21 22:48 +0100
                                                                                          Re: Why does vector::reserve() not grow exponentially ? Juha Nieminen <nospam@thanks.invalid> - 2021-06-22 05:30 +0000
                                                                                            Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-21 23:12 -0700
                                                                                              Re: Why does vector::reserve() not grow exponentially ? MrSpook_D_a3U17y@j_az.net - 2021-06-22 07:14 +0000
                                                                                                Re: Why does vector::reserve() not grow exponentially ? Manfred <noname@add.invalid> - 2021-06-22 13:49 +0200
                                                                                              Re: Why does vector::reserve() not grow exponentially ? Juha Nieminen <nospam@thanks.invalid> - 2021-06-22 08:03 +0000
                                                                                                Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-22 01:28 -0700
                                                                                                  Re: Why does vector::reserve() not grow exponentially ? Juha Nieminen <nospam@thanks.invalid> - 2021-06-23 06:19 +0000
                                                                                                    Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-23 04:18 -0700
                                                                                  Re: Why does vector::reserve() not grow exponentially ? Juha Nieminen <nospam@thanks.invalid> - 2021-06-21 12:39 +0000
                                                                    Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-15 08:01 +0200
                                                                      Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-15 08:12 -0400
                                                                        Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-15 15:34 +0200
                                                                          Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-15 17:37 -0400
                                                                            Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-16 02:17 +0200
                                                                              Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-15 21:11 -0400
                                                                                Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-16 07:09 +0200
                                                                                  Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-16 06:37 -0400
                                                                                    Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-16 13:01 +0200
                                                                                      Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-16 08:16 -0400
                                                                                        Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-16 15:35 +0200
                                                                                          Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-16 17:40 -0400
                                                                                  Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-16 13:40 +0200
                                                                                    Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-16 18:10 +0300
                                                                                  Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-16 14:37 +0300
                                                                                  Re: Why does vector::reserve() not grow exponentially ? scott@slp53.sl.home (Scott Lurndal) - 2021-06-16 15:04 +0000
                                                                                    Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-16 17:37 +0200
                                                                                      Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-16 17:40 -0400
                                                                                        Re: Why does vector::reserve() not grow exponentially ? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-06-16 16:25 -0700
                                                                                          Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-16 23:17 -0400
                                                                                            Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-17 09:22 +0200
                                                                                              Re: Why does vector::reserve() not grow exponentially ? MrSpook_e0mt@hszpo62mi.com - 2021-06-17 08:31 +0000
                                                                                        Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-17 07:11 +0200
                                                                                          Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-17 09:24 -0400
                                                                                            Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-17 16:43 +0200
                                                    Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-13 08:11 -0400
                                                Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-13 08:10 -0400
                                      Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-12 14:01 +0200
                                        Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 15:34 +0200
                                      Re: Why does vector::reserve() not grow exponentially ? Ian Collins <ian-news@hotmail.com> - 2021-06-13 13:01 +1200
                                        Re: Why does vector::reserve() not grow exponentially ? Öö Tiib <ootiib@hot.ee> - 2021-06-13 07:39 -0700
                            Re: Why does vector::reserve() not grow exponentially ? Bo Persson <bo@bo-persson.se> - 2021-06-12 10:51 +0200
                              Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 11:03 +0200
                                Re: Why does vector::reserve() not grow exponentially ? Bo Persson <bo@bo-persson.se> - 2021-06-12 13:07 +0200
                                  Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 13:22 +0200
                            Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-12 08:52 -0400
              Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-10 16:51 -0700
            Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-11 09:52 +0200
              Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-11 13:17 +0200
                Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-11 13:45 +0200
                  Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-11 13:54 +0200
                    Re: Why does vector::reserve() not grow exponentially ? David Brown <david.brown@hesbynett.no> - 2021-06-11 15:58 +0200
                      Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-11 16:35 +0200
                        Re: Why does vector::reserve() not grow exponentially ? Manfred <noname@add.invalid> - 2021-06-11 17:11 +0200
                          Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-11 17:12 +0200
                        Re: Why does vector::reserve() not grow exponentially ? Christian Gollwitzer <auriocus@gmx.de> - 2021-06-11 21:15 +0200
                    Re: Why does vector::reserve() not grow exponentially ? Bo Persson <bo@bo-persson.se> - 2021-06-11 21:58 +0200
                      Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-12 04:11 +0200
            Re: Why does vector::reserve() not grow exponentially         ? Sam <sam@email-scan.com> - 2021-06-11 06:55 -0400
              Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-11 13:19 +0200
          Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-10 16:51 +0200
          Re: Why does vector::reserve() not grow exponentially ? MrSpook_sw@08_cl170xu11o4f8xcg45.co.uk - 2021-06-10 15:25 +0000
            Re: Why does vector::reserve() not grow exponentially ? Bonita Montero <Bonita.Montero@gmail.com> - 2021-06-10 18:18 +0200
            Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-10 22:40 +0300
              Re: Why does vector::reserve() not grow exponentially ? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2021-06-10 22:35 +0200
                Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-11 09:23 +0300
                  Re: Why does vector::reserve() not grow exponentially ? Bo Persson <bo@bo-persson.se> - 2021-06-11 12:02 +0200
                    Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-11 03:05 -0700
                      Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-11 03:22 -0700
                      Re: Why does vector::reserve() not grow exponentially ? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2021-06-11 12:25 +0200
                        Re: Why does vector::reserve() not grow exponentially ? MrSpook_4421gcxq@fceufv2.ac.uk - 2021-06-11 11:39 +0000
                      Re: Why does vector::reserve() not grow exponentially ? MrSpook_3wcC2u9@cns8.net - 2021-06-11 10:18 +0000
                    Re: Why does vector::reserve() not grow exponentially ? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-11 03:27 -0700
                    Re: Why does vector::reserve() not grow exponentially ? MrSpook_4bkzrb03@tu45utvus6nuc.tv - 2021-06-11 10:17 +0000
                      Re: Why does vector::reserve() not grow exponentially ? Manfred <noname@add.invalid> - 2021-06-11 13:22 +0200
                        Re: Why does vector::reserve() not grow exponentially ? MrSpook_0nG@p900whw6_n8r7ovwuul.ac.uk - 2021-06-11 11:34 +0000
                          Re: Why does vector::reserve() not grow exponentially ? Manfred <noname@add.invalid> - 2021-06-11 14:14 +0200
                            Re: Why does vector::reserve() not grow exponentially ? MrSpook_p_5Ko4g@21yhpi_n4fck_wfz.org - 2021-06-11 12:50 +0000
                  Re: Why does vector::reserve() not grow exponentially ? MrSpook_0sk4i3p@b1km5k73i1.edu - 2021-06-11 09:24 +0000
                    Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-11 14:18 +0300
              Re: Why does vector::reserve() not grow exponentially ? Bo Persson <bo@bo-persson.se> - 2021-06-11 11:59 +0200
                Re: Why does vector::reserve() not grow exponentially ? MrSpook_jyc2xeWf9@aw55u6.gov - 2021-06-11 10:17 +0000
              Re: Why does vector::reserve() not grow exponentially ? MrSpook_3dnim@5ooodqy.co.uk - 2021-06-11 09:19 +0000
                Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-11 14:26 +0300
                  Re: Why does vector::reserve() not grow exponentially ? MrSpook_35@s879vvmwpgee7rpqv.net - 2021-06-11 11:38 +0000
                    Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-11 15:14 +0300
                      Re: Why does vector::reserve() not grow exponentially ? MrSpook_uQjuVe@5szcyauh_pjzi228wvwn.info - 2021-06-11 12:52 +0000
                        Re: Why does vector::reserve() not grow exponentially ? Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-11 16:37 +0300
                          Re: Why does vector::reserve() not grow exponentially ? MrSpook_9fpRQm@i1z834r.net - 2021-06-11 14:58 +0000
                          Re: Why does vector::reserve() not grow exponentially ? Manfred <noname@add.invalid> - 2021-06-11 17:06 +0200

Page 1 of 13  [1] 2 3 … 13  Next page →


#80243 — Why does vector::reserve() not grow exponentially ?

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-06-10 12:18 +0200
SubjectWhy does vector::reserve() not grow exponentially ?
Message-ID<s9sot3$lt2$1@dont-email.me>
vector is specified to have a amortized constant overhead for inserting
new elements. Because of that ::emplace_back() et al grow the capacity
exponentiallly if necessarsy (2x for libstdc++, 1.5x for MSVC). But why
does this not apply for vector::reserve() ? It could simply handle the
reservations in a way that the increase which should be made is below
the next exponential step, the given size doesn't count but the next
anticipated step. That would be the most logical way for me to handle
this issue.

[toc] | [next] | [standalone]


#80244

FromBo Persson <bo@bo-persson.se>
Date2021-06-10 13:21 +0200
Message-ID<iieastFmfr0U1@mid.individual.net>
In reply to#80243
On 2021-06-10 at 12:18, Bonita Montero wrote:
> vector is specified to have a amortized constant overhead for inserting
> new elements. Because of that ::emplace_back() et al grow the capacity
> exponentiallly if necessarsy (2x for libstdc++, 1.5x for MSVC). But why
> does this not apply for vector::reserve() ? It could simply handle the
> reservations in a way that the increase which should be made is below
> the next exponential step, the given size doesn't count but the next
> anticipated step. That would be the most logical way for me to handle
> this issue.
> 

I believe the idea is that you use reserve() when you have a good idea 
of what the final size is likely to be.

I wouldn't want the implementation to allocate 50-100% additional space 
just in case the vector would continue to grow. Presumably, when calling 
reserve() I know that it will not.

[toc] | [prev] | [next] | [standalone]


#80245

FromPaavo Helde <myfirstname@osa.pri.ee>
Date2021-06-10 14:37 +0300
Message-ID<s9sti1$luq$1@dont-email.me>
In reply to#80243
10.06.2021 13:18 Bonita Montero kirjutas:
> vector is specified to have a amortized constant overhead for inserting
> new elements. Because of that ::emplace_back() et al grow the capacity
> exponentiallly if necessarsy (2x for libstdc++, 1.5x for MSVC). But why
> does this not apply for vector::reserve() ?

Because reserve() is only needed for the case when the default 
exponential growth is not appropriate for some reason. If so, only the 
programmer can know how it's not appropriate and how the buffer should 
grow. So there would be little point to double-guess it and do something 
else automatically.

 > It could simply handle the
 > reservations in a way that the increase which should be made is below
 > the next exponential step, the given size doesn't count but the next
 > anticipated step.

I'm not sure I understand this sentence.

 > That would be the most logical way for me to handle
 > this issue.

What issue?

[toc] | [prev] | [next] | [standalone]


#80246

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-06-10 15:44 +0200
Message-ID<s9t4vl$al3$1@dont-email.me>
In reply to#80245
> Because reserve() is only needed for the case when the default 
> exponential growth is not appropriate for some reason. ...

The standard says:
  "After reserve(), capacity() is _greater or equal_
   to the argumentof reserve if reallocation happens ..."
So the standard gives the vector-implementation the freedom to grow
beyond the size you supply with resize(). I think that's because the
vector has to satisfy the amortized constant inserts.

[toc] | [prev] | [next] | [standalone]


#80247

FromDavid Brown <david.brown@hesbynett.no>
Date2021-06-10 16:39 +0200
Message-ID<s9t86i$2g8$1@dont-email.me>
In reply to#80246
On 10/06/2021 15:44, Bonita Montero wrote:
>> Because reserve() is only needed for the case when the default
>> exponential growth is not appropriate for some reason. ...
> 
> The standard says:
>  "After reserve(), capacity() is _greater or equal_
>   to the argumentof reserve if reallocation happens ..."
> So the standard gives the vector-implementation the freedom to grow
> beyond the size you supply with resize(). I think that's because the
> vector has to satisfy the amortized constant inserts.

No, that would make no sense.  It is simply to allow the implementation
to round up the capacity a bit if that suits the memory allocator -
perhaps it allocates in lumps of 4K, or cache aligned sizes, or
something else that means when you ask for space for 19 elements it
might give you 24 elements.

You use "reserve" when you know how your vector will grow, because it is
more efficient to jump to the right size than grow exponentially.  If
you know you are going to store 1000 elements, you reserve space for
1000 (and don't care if the implementation sets the actual capacity to
1024).  That is far faster than starting with 1 element and doubling 10
times, or scaling by 1.5 in 17 steps.

[toc] | [prev] | [next] | [standalone]


#80248

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-06-10 16:47 +0200
Message-ID<s9t8mu$5fi$1@dont-email.me>
In reply to#80247
> No, that would make no sense.  It is simply to allow the implementation
> to round up the capacity a bit if that suits the memory allocator - ...

There are no rounding memory-allocators. You say the allocator you
want size = n * sizeof(type) memory and it gives you the memory and
the allocator-API doesn't give you the opportunity to get the size
actually allocated. So you're wrong.

[toc] | [prev] | [next] | [standalone]


#80259

FromBo Persson <bo@bo-persson.se>
Date2021-06-10 22:00 +0200
Message-ID<iif9ahFs8egU1@mid.individual.net>
In reply to#80248
On 2021-06-10 at 16:47, Bonita Montero wrote:
>> No, that would make no sense.  It is simply to allow the implementation
>> to round up the capacity a bit if that suits the memory allocator - ...
> 
> There are no rounding memory-allocators. You say the allocator you
> want size = n * sizeof(type) memory and it gives you the memory and
> the allocator-API doesn't give you the opportunity to get the size
> actually allocated. So you're wrong.
> 

A standard library for a specific system will just *know* that the 
memory allocator is pooled and works in certain chunks.

For example, if you ask for size = 1 * sizeof(char), you will never get 
a single byte. You will get 16 bytes.

It is then just rational for reserve(1) to result in capacity == 16.

[toc] | [prev] | [next] | [standalone]


#80260

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-06-10 22:09 +0200
Message-ID<s9trhe$3k7$1@dont-email.me>
In reply to#80259
> A standard library for a specific system will just *know* that the 
> memory allocator is pooled and works in certain chunks.

This is the requirement for a container-compliant allocator:
https://en.cppreference.com/w/cpp/named_req/Allocator
Where's the interface that supplies the container the real
size of an allocated memory-block ?

[toc] | [prev] | [next] | [standalone]


#80289 — Re: Why does vector::reserve() not grow exponentially ?

FromSam <sam@email-scan.com>
Date2021-06-11 06:57 -0400
SubjectRe: Why does vector::reserve() not grow exponentially ?
Message-ID<cone.1623409045.517003.139076.1004@monster.email-scan.com>
In reply to#80260

[Multipart message — attachments visible in raw view] — view raw

Bonita Montero writes:

>> A standard library for a specific system will just *know* that the memory  
>> allocator is pooled and works in certain chunks.
>
> This is the requirement for a container-compliant allocator:
> https://en.cppreference.com/w/cpp/named_req/Allocator
> Where's the interface that supplies the container the real
> size of an allocated memory-block ?

Just because something isn't specified for a library class, doesn't mean  
that the implementation is prohibited from having it.

If you look at your header files for the methods of, say,  
std::unordered_map, you will recoil in horror at seeing all sorts of class  
methods that are nowhere to be found in the C++ specification.

[toc] | [prev] | [next] | [standalone]


#80291

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-06-11 13:16 +0200
Message-ID<s9vgmb$4ns$1@dont-email.me>
In reply to#80289
> Just because something isn't specified for a library class, doesn't mean 
> that the implementation is prohibited from having it.

The containers _always_ use allocators that provide the allocatotor
-interface which is specified under the link I've shown you. And
with this there is no opportunity to get the size of the memory
actually allocated.

[toc] | [prev] | [next] | [standalone]


#80297

FromBo Persson <bo@bo-persson.se>
Date2021-06-11 13:27 +0200
Message-ID<iigvlvF7lsmU1@mid.individual.net>
In reply to#80291
On 2021-06-11 at 13:16, Bonita Montero wrote:
>> Just because something isn't specified for a library class, doesn't 
>> mean that the implementation is prohibited from having it.
> 
> The containers _always_ use allocators that provide the allocatotor
> -interface which is specified under the link I've shown you. And
> with this there is no opportunity to get the size of the memory
> actually allocated.

The library implementor knows how std::allocator gets its memory, 
because he wrote that earlier.

So he can predict what the underlying memory manager will actually 
return when you ask for 7, or 53, bytes. The container can make use of 
that knowledge, for example by asking the allocator for 64 bytes instead 
of 53. And now reserve(53) can result in capacity() == 64.

[toc] | [prev] | [next] | [standalone]


#80303

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-06-11 13:53 +0200
Message-ID<s9vir6$7ns$1@dont-email.me>
In reply to#80297
> The library implementor knows how std::allocator gets its memory, 
> because he wrote that earlier.

The allocator template-parameter is replaceable, so the code calling
it has to adhere to its interface. So there's no opportunity to get
the size actually physically allocated.

[toc] | [prev] | [next] | [standalone]


#80326 — Re: Why does vector::reserve() not grow exponentially ?

FromSam <sam@email-scan.com>
Date2021-06-11 19:12 -0400
SubjectRe: Why does vector::reserve() not grow exponentially ?
Message-ID<cone.1623453153.68873.152364.1004@monster.email-scan.com>
In reply to#80303

[Multipart message — attachments visible in raw view] — view raw

Bonita Montero writes:

>> The library implementor knows how std::allocator gets its memory, because he  
>> wrote that earlier.
>
> The allocator template-parameter is replaceable, so the code calling
> it has to adhere to its interface. So there's no opportunity to get
> the size actually physically allocated.

SFINAE, or concepts, can be used to determine whether the allocator  
implements an extended interface that's supported by the library and then  
use it, if it exists. Otherwise the container template will use only the  
standard-specified interface.


[toc] | [prev] | [next] | [standalone]


#80327

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-06-12 04:09 +0200
Message-ID<sa1508$qb9$3@dont-email.me>
In reply to#80326
> SFINAE, or concepts, can be used to determine whether the allocator 
> implements an extended interface that's supported by the library and 
> then use it, if it exists. Otherwise the container template will use 
> only the standard-specified interface.

Extremely unlikely.

[toc] | [prev] | [next] | [standalone]


#80350 — Re: Why does vector::reserve() not grow exponentially ?

FromSam <sam@email-scan.com>
Date2021-06-12 08:50 -0400
SubjectRe: Why does vector::reserve() not grow exponentially ?
Message-ID<cone.1623502204.98514.164969.1004@monster.email-scan.com>
In reply to#80327

[Multipart message — attachments visible in raw view] — view raw

Bonita Montero writes:

>> SFINAE, or concepts, can be used to determine whether the allocator  
>> implements an extended interface that's supported by the library and then  
>> use it, if it exists. Otherwise the container template will use only the  
>> standard-specified interface.
>
> Extremely unlikely.

Whether it is unlikely or not, it's perfectly doable.

[toc] | [prev] | [next] | [standalone]


#80355

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-06-12 15:43 +0200
Message-ID<sa2dm9$mue$1@dont-email.me>
In reply to#80350
>> Extremely unlikely.

> Whether it is unlikely or not, it's perfectly doable.

A lot of people expect the C++-container indirectly base on malloc()
to have replaceable memory-allocation to install a faster allocator
like mimalloc. Therefore it's the most realistic assumption to say
that everything in the standard-library indirectly bases on malloc().

[toc] | [prev] | [next] | [standalone]


#80360 — Re: Why does vector::reserve() not grow exponentially ?

FromSam <sam@email-scan.com>
Date2021-06-12 18:59 -0400
SubjectRe: Why does vector::reserve() not grow exponentially ?
Message-ID<cone.1623538778.133352.173730.1004@monster.email-scan.com>
In reply to#80355

[Multipart message — attachments visible in raw view] — view raw

Bonita Montero writes:

>>> Extremely unlikely.
>
>> Whether it is unlikely or not, it's perfectly doable.
>
> A lot of people expect the C++-container indirectly base on malloc()
> to have replaceable memory-allocation to install a faster allocator
> like mimalloc. Therefore it's the most realistic assumption to say
> that everything in the standard-library indirectly bases on malloc().

Once more: what "people expect" is immaterial. As long as a particular  
implementation is in compliance with the C++ standard, then that's the end  
of it. And I'm afraid that is not the case. The C++ standard explicitly  
states that it does not specify whether operator new uses malloc.

# 17.6.2.1 Single-object forms [new.delete.single]
#
# [[nodiscard]] void* operator new(std::size_t size);
#
# [[nodiscard]] void* operator new(std::size_t size, std::align_val_t alignment);
#
# …
#
# Whether the attempt involves a call to the C standard library functions
# malloc or aligned_alloc is unspecified.

The C++ standard authoritatively asserts that it's unspecified whether new  
is implemented in terms of malloc. Too bad if someone's expectations were  
otherwise.

Now, I don't actually see what that has to do with the original proposition  
of std::vector::reserve()'s optimization, but since (for some odd reason)  
you chose to sidetrack into your expectations of new's behavior, I have to  
set the record straight:

The C++ standard does not require that operator new must be implemented in  
terms of malloc. Feel free to "expect" otherwise. Your expectations may not  
be realized, unfortunately.

The End.

[toc] | [prev] | [next] | [standalone]


#80367

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-06-13 07:31 +0200
Message-ID<sa456p$mij$1@dont-email.me>
In reply to#80360
> Once more: what "people expect" is immaterial. ...

It's realistisc.

Rest of your stupid stuff unread.

[toc] | [prev] | [next] | [standalone]


#80374 — Re: Why does vector::reserve() not grow exponentially ?

FromSam <sam@email-scan.com>
Date2021-06-13 08:09 -0400
SubjectRe: Why does vector::reserve() not grow exponentially ?
Message-ID<cone.1623586181.606294.183548.1004@monster.email-scan.com>
In reply to#80367

[Multipart message — attachments visible in raw view] — view raw

Bonita Montero writes:

>> Once more: what "people expect" is immaterial. ...
>
> It's realistisc.

Realistically, people are also always going to whine when they relied on  
unspecified behavior, and their code breaks.

Also realistically: nobody will care.

> Rest of your stupid stuff unread.

I believe you 100%, just like I believe that you will not read every  
character of this post.

[toc] | [prev] | [next] | [standalone]


#80376

FromBonita Montero <Bonita.Montero@gmail.com>
Date2021-06-13 14:12 +0200
Message-ID<sa4sn7$mpq$1@dont-email.me>
In reply to#80374
>>> Once more: what "people expect" is immaterial. ...

>> It's realistisc.

> Realistically, people are also always going to whine when
> they relied on  unspecified behavior, and their code breaks.

That's sth. totally different here and I told whether it's the most
reasonable assumption: there are many people that expect their alloca-
tions to be globally replaceable. Because of that C++ memory-allcoation
also indiretly bases on malloc() in some way.

[toc] | [prev] | [next] | [standalone]


Page 1 of 13  [1] 2 3 … 13  Next page →

Back to top | Article view | comp.lang.c++


csiph-web