public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nicola at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libobjc/47012] nonatomic Properties behave wrong
Date: Sun, 19 Dec 2010 19:12:00 -0000	[thread overview]
Message-ID: <bug-47012-4-Dw7P1cO1PR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47012-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47012

--- Comment #4 from Nicola Pero <nicola at gcc dot gnu.org> 2010-12-19 19:12:33 UTC ---
Yes, I was actually thinking about this, and you're right - it makes sense not
to use retain/autorelease! ;-)

'nonatomic' means that other threads are not involved.  Which also means that
the programmer calling the accessor has full control of what happens (there
aren't alternative flows of execution that may jump in); he should do the
retain/autorelease himself if there is a risk that something he does while
using the object returned may call the accessor setter and trigger a release of
the object; else, he can get away without a retain/autorelease and get a good
speedup.

And doing the same that Apple does is obviously helpful for portability.

So I made the change in subversion.

Thanks

PS: GCC is currently in bug-fixing mode only for 4.6 so we can't accept
non-bug-fix changes, but as soon as it reopens, you're very welcome to
contribute.  Faster method lookup sounds very exciting (and non-trivial).


  parent reply	other threads:[~2010-12-19 19:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-19 12:10 [Bug libobjc/47012] New: nonatimic " js-gcc at webkeks dot org
2010-12-19 18:31 ` [Bug libobjc/47012] nonatomic " nicola at gcc dot gnu.org
2010-12-19 18:49 ` js-gcc at webkeks dot org
2010-12-19 19:10 ` nicola at gcc dot gnu.org
2010-12-19 19:12 ` nicola at gcc dot gnu.org [this message]
2010-12-19 19:15 ` nicola at gcc dot gnu.org
2010-12-19 19:19 ` js-gcc at webkeks dot org
2010-12-21 10:56 ` nicola at gcc dot gnu.org
2010-12-21 11:26 ` js-gcc at webkeks dot org
2010-12-21 11:39 ` nicola at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-47012-4-Dw7P1cO1PR@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).