- Users needed - 6 Updates
- merge-sort with alloca()-buffer - 2 Updates
- C++17 and alignment... - 8 Updates
| scott@slp53.sl.home (Scott Lurndal): Jan 25 11:48PM >No she won't - the only thing Bonita will ever find is what C++ is used >for by Bonita, and that apparently only includes large scale program >development. I really doubt that Bonita has ever developed a large-scale program of any type. |
| scott@slp53.sl.home (Scott Lurndal): Jan 25 11:50PM >> the size of the executable codefile is completely uninteresting >> and not worth spending any time optimizing. >Not always true. Well, we agree. The size of the loadable sections (e.g. 'text/data/bss'), is indeed interesting. The size of codefile (ELF, COFF, PE), not so much. |
| James Kuyper <jameskuyper@alumni.caltech.edu>: Jan 25 09:46PM -0500 > the group. And to paraphrase my old grammar school teacher, when James > talks about Bonita, we learn more about James than we do about > Bonita. Yes, and what you learned about me was how annoyed I am at Bonita's strong tendency to consider that her own personal experience is the entire universe of possibilities that needs to be considered. I am personally very well aware that there's a lot of different kinds of programming being done out there, most of it quite different from the kind I personally have any experience with. |
| Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 26 07:10AM On Mon, 2021-01-25, Scott Lurndal wrote: >>Not always true. > Well, we agree. The size of the loadable sections (e.g. 'text/data/bss'), is indeed > interesting. The size of codefile (ELF, COFF, PE), not so much. The file size can be limiting, too, even in the server/desktop world. I wanted to build our stuff with debug info included recently, but had to give up since it increased disk usage greatly. (A factor 50 or something: we use a lot of template metaprogramming.) /Jorgen -- // Jorgen Grahn <grahn@ Oo o. . . \X/ snipabacken.se> O o . |
| David Brown <david.brown@hesbynett.no>: Jan 26 03:37PM +0100 On 26/01/2021 08:10, Jorgen Grahn wrote: > I wanted to build our stuff with debug info included recently, but had > to give up since it increased disk usage greatly. (A factor 50 or > something: we use a lot of template metaprogramming.) Are you using gcc? There are a few flags that affect the visibility of symbols that might make a difference. (I do little desktop programming in C++, so I haven't tried these myself - I've just come across them when reading the reference manual.) -fvisibility-inlines-hidden -fvisibility=hidden Also look at: -gsplit-dwarf -gz=zlib |
| Bonita Montero <Bonita.Montero@gmail.com>: Jan 26 10:21PM +0100 > Basically, when you make general statements about how C++ is used and > what is important, you will get it wrong. Look at what I wrote. I didn't make a general statement. |
| Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 26 07:22AM On Sun, 2021-01-24, Öö Tiib wrote: > I very rarely have to step in code for anything and if I need then > it is usually because of being written by such debugger steppors. Same here. I don't rule out, though, that others can use stepping efficiently. My coworkers all do it (or say they want to). > Good code uses unit tests to verify its correctness and what C++ > unit test framework out there does not use preprocessor? Mine -- but then I didn't focus on getting good failure reports from it. I can tell my tests to dump core if they fail. /Jorgen -- // Jorgen Grahn <grahn@ Oo o. . . \X/ snipabacken.se> O o . |
| Juha Nieminen <nospam@thanks.invalid>: Jan 26 12:14PM > All discussions go downhill very quickly as soon as people start feeling > the need to comment on the deficiencies of the poster as opposed to > the content of the post. Or when they start making untrue claims about someone's answer, and stubborningly refuse to back off. |
| Bonita Montero <Bonita.Montero@gmail.com>: Jan 26 05:08AM +0100 >> needed because you use different allocation-functions then which >> do this alignment. > What if somebody wants to do page alignment using standard C++? Then he uses mmap() or VirtualAlloc. |
| "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 25 08:19PM -0800 On 1/25/2021 8:08 PM, Bonita Montero wrote: >>> do this alignment. >> What if somebody wants to do page alignment using standard C++? > Then he uses mmap() or VirtualAlloc. Well, that's not quite standard C++ is it... |
| Bonita Montero <Bonita.Montero@gmail.com>: Jan 26 05:42AM +0100 >>> What if somebody wants to do page alignment using standard C++? >> Then he uses mmap() or VirtualAlloc. > Well, that's not quite standard C++ is it... Since you can't rely on alignas(pagesize) that's not standard also. |
| "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 25 08:47PM -0800 On 1/25/2021 8:42 PM, Bonita Montero wrote: >>> Then he uses mmap() or VirtualAlloc. >> Well, that's not quite standard C++ is it... > Since you can't rely on alignas(pagesize) that's not standard also. A compiler is allowed to support over alignment without resorting to system specific calls. How many different systems have compilers that support over alignment? Just like the atomic library and the following: https://en.cppreference.com/w/cpp/atomic/atomic_is_lock_free You see? Some compilers may use locks to implement their atomics, others do not. Does that mean we should not use std::atomic? |
| Sam <sam@email-scan.com>: Jan 26 12:29AM -0500 Chris M. Thomasson writes: >>> What if somebody wants to do page alignment using standard C++? >> Then he uses mmap() or VirtualAlloc. > Well, that's not quite standard C++ is it... Of course not. There's nothing in the C++ standard about anything called "pages". |
| "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 25 09:57PM -0800 On 1/25/2021 9:29 PM, Sam wrote: >> Well, that's not quite standard C++ is it... > Of course not. There's nothing in the C++ standard about anything called > "pages". Indeed. Say we want to use alignas to align and pad a structure up to, say, a 4096 byte alignment. Or even 8192 alignment. The C++ standard does not mention level 2 cache lines as well. However C++17 explicitly allows for over alignment. Then there is std::aligned_alloc. Going outside of C++: https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html I would like to try and do these type of things without resorting to system specific calls. |
| Bonita Montero <Bonita.Montero@gmail.com>: Jan 26 08:28AM +0100 > A compiler is allowed to support over alignment without resorting to > system specific calls. How many different systems have compilers that > support over alignment? A compiler can't distinguish between memory allocated with mmap() or VirtualAlloc() and new from its own pools. So it has to use new also, even when you have a page-alignment. So the runtime has to do an over -allocation and round up the pointer to the next page-boundary. With an alignement of a page-size that's a much of waste. |
| "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 25 11:32PM -0800 On 1/25/2021 11:28 PM, Bonita Montero wrote: > even when you have a page-alignment. So the runtime has to do an over > -allocation and round up the pointer to the next page-boundary. With > an alignement of a page-size that's a much of waste. Wow. Before I make a proper response, I will let you ponder on what you just wrote. Signing off for tonight. |
| You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment