• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: suboptimal code-gen of decrement in GCC 4.2.1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: suboptimal code-gen of decrement in GCC 4.2.1


  • Subject: Re: suboptimal code-gen of decrement in GCC 4.2.1
  • From: Greg Guerin <email@hidden>
  • Date: Wed, 14 Oct 2009 17:24:06 -0700

Jens Alfke wrote:

void deref() { if (--m_refCount == 0) delete this; }

Two things come to mind:

1. Are any of the variables involved declared 'volatile'?

2. Are you looking at this code because measurements have shown it to be significant, or is this purely a theoretical concern?

With the x86, more instructions aren't always slower, due to pipelining and other architecture internals. Without knowing specifics of the 'decl (ëx)' sequence of bus operations, maybe it's doing an interlocked access that ends up slower than the longer instruction sequence. In other words, it seems sub-optimal, but does it really run sub-optimally?

  -- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Interface Builder lost synchronization with Xcode
  • Next by Date: Interface builder & sample data
  • Previous by thread: Re: suboptimal code-gen of decrement in GCC 4.2.1
  • Next by thread: Interface Builder lost synchronization with Xcode
  • Index(es):
    • Date
    • Thread