- pass by value mysteries - 10 Updates
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 24 02:35AM +0100 On 23/09/2016 12:34, Stefan Ram wrote: > crusader.mike@gmail.com writes: >> So, exactly what happens on stack when you have some > There is no stack. C++ is not assembler. What difference does whether it is C++ or assembler make to whether or not there is a stack? Of course there is a fucking stack you fucking mentalist; the C++ ISO Standard even mentions it. /Flibble |
Jerry Stuckle <jstucklex@attglobal.net>: Sep 23 10:53PM -0400 On 9/23/2016 9:35 PM, Mr Flibble wrote: > Of course there is a fucking stack you fucking mentalist; the C++ ISO > Standard even mentions it. > /Flibble The stack in the C++ standard is not necessarily a hardware stack. Otherwise you could not compile and run C++ (or C, for that matter) programs in IBM mainframes - which have no hardware stack. The stack in the C++ standard is a concept. It can be implemented as a hardware stack, a chain of save areas or any other similar means. -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ================== |
Michael Kilburn <crusader.mike@gmail.com>: Sep 23 08:00PM -0700 On Friday, September 23, 2016 at 11:37:21 AM UTC-5, Alf P. Steinbach wrote: > On 23.09.2016 14:25, Paavo Helde wrote: > > On 23.09.2016 14:34, Stefan Ram wrote: For some reason Stefan Ram's post doesn't show up in Google Groups... Can someone repost it (only if it contains correct answers to Q #1 and #2)? Overall I see 4 reply posts in Groups and none of them answer main questions. Regarding stack -- the fact that there is a hardware where stack isn't really a stack (even though it is essentially a stack) does not justify inefficient (or incorrect) behavior of code generated for IA-32 :-) > In short, clc++m is apparently dead. Shame |
Melzzzzz <Melzzzzz@zzzzz.com>: Sep 24 03:55AM > stack isn't really a stack (even though it is essentially a stack) does > not justify inefficient (or incorrect) behavior of code generated for > IA-32 :-) Your question does not have to do anything with stack... Object passed by value are usually constructed at the caller site and destructed there, while hidden pointers to them are passed to functions. How many objects will be constructed does not depends at all if stack is used (or not)... You have to prepare for worst case always... -- press any key to continue or any other to quit |
Paavo Helde <myfirstname@osa.pri.ee>: Sep 24 06:35PM +0300 On 24.09.2016 6:00, Michael Kilburn wrote: >>> On 23.09.2016 14:34, Stefan Ram wrote: > For some reason Stefan Ram's post doesn't show up in Google Groups... Can someone repost it (only if it contains correct answers to Q #1 and #2)? > Overall I see 4 reply posts in Groups and none of them answer main questions. Regarding stack -- the fact that there is a hardware where stack isn't really a stack (even though it is essentially a stack) does not justify inefficient (or incorrect) behavior of code generated for IA-32 :-) FYI: there were no answers in Stefan Ram's post, just some nitpicking over "stack" and a remark that an implicitly defined move constructor might have some role here (which I think is not the case because presence of an explicit destructor prohibits creation of an implicit move constructor). As the context is snipped away here, I will try to answer the OP questions in another reply. Cheers Paavo |
woodbrian77@gmail.com: Sep 24 10:21AM -0700 On Friday, September 23, 2016 at 7:26:05 AM UTC-5, Paavo Helde wrote: > > indentations) > Really? Only indendantion? If I were a moderator, I would certainly > change the ::std:: prefixes as well. I'm thankful for the freedom in this newsgroup to use the :: prefixes. I rarely used c.l.c++.m so this apparent fading away isn't a big deal to me. It may even be beneficial in that some people from that newsgroup may be added to this newsgroup, which IMO is easier to deal with than c.l.c++.m was. Brian Ebenezer Enterprises - In G-d we trust. http://webEbenezer.net |
woodbrian77@gmail.com: Sep 24 10:25AM -0700 On Friday, September 23, 2016 at 8:35:31 PM UTC-5, Mr Flibble wrote: > > There is no stack. C++ is not assembler. > What difference does whether it is C++ or assembler make to whether or > not there is a stack? Leigh, please don't swear here. Brian Ebenezer Enterprises |
Paavo Helde <myfirstname@osa.pri.ee>: Sep 24 09:12PM +0300 > F dtor > Now this is totally unexpected. For some reason compiler decided to make few extra copies (by means of either copy ctor or move ctor). I made these objects real big (added int v[1000]) -- it changed nothing. > Question #1: Why? What is going on here? As the classes contain no data, I guess the compiler decided to create some copies "as if" via copy constructor (which is a null-op, so zero cost). If you put some content in G1, G2, e.g. another class object with printouts in ctor, dtor, copy ctor, move ctor, then the behavior goes back to the previous (less objects created-destroyed). In general, if you want to avoid unneeded copies in situations like here, define proper move (rvalue) constructors for your classes. Relying on the compiler to optimize the copies away is not guaranteed (though might probably work in simple scenarios). > F dtor > hiding copy constructors has no effect on GCC. > Question #2: Why GCC output looks like this? What is going on here? What do you mean? As far as I can see there is exactly 1 ctor and 1 dtor call for each object. All objects other than F are destroyed before the semicolon is reached in the first line of main. What do you think is wrong here? > Question #3: What happened to comp.lang.c++.moderated in Google Groups? It shows last message from May 22 for me. No idea, I stopped to use it many years ago because of unbearable response loop times. Cheers Paavo |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 24 08:15PM +0100 >> What difference does whether it is C++ or assembler make to whether or >> not there is a stack? > Leigh, please don't swear here. 'This video may contain sexual swearwords, I'm afraid. There are 28 'fucks'. Including that one 29. Ah, fuck it, make it 30.' -- Paul Calf https://www.youtube.com/watch?v=42UCpOzTbNU /Flibble |
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Sep 25 12:09AM +0100 On Sat, 24 Sep 2016 10:21:51 -0700 (PDT) woodbrian77@gmail.com wrote: [snip] > that some people from that newsgroup may be added to this > newsgroup, which IMO is easier to deal with than c.l.c++.m > was. Well I hope c.l.c++.m doesn't go because it may well be needed shortly. Religious nutjobs like you and Rick, who can't control themselves and have no concern for the supposed topic of this newsgroup are in danger of making it unusable for serious discussion of C++. At least the nonsense that Rick and you come up with wouldn't get past the moderator on c.l.c++.m. While I am on the subject of nutjobs, you are free to prefix your use of the std namespace with the :: global scope operator with or without this newsgroup and any supposed freedom for which you are thankful. You comment on this above is bizarre enough as it stands. But holding out the :: prefix as an attribute of a "royal priesthood" as in your recent post? Please... you are raving. |
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