• 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: Bizarre x86 segment layout problem causing select() slowdown: solved, sort of
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bizarre x86 segment layout problem causing select() slowdown: solved, sort of


  • Subject: Re: Bizarre x86 segment layout problem causing select() slowdown: solved, sort of
  • From: Chris Page <email@hidden>
  • Date: Wed, 7 Feb 2007 23:09:43 -0800

On Feb 7, 2007, at 10:49 AM, Jonas Maebe wrote:

On 07 Feb 2007, at 19:34, Dave Hayden wrote:

Looking at the code again, I noticed this in the socket setup code:

setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void*)32768, sizeof(int));

Shouldn't you pass the address of a variable containing the buffer size rather than the actual value? Have you tried checking the return value of that call?

A few points from a pedant, since nobody mentioned this:

1. Never use explicit casts unless you absolutely must. They can silently throw away type information.

2. Never use C-style casts in C++, they always silently throw away type information.

3. If you must perform an explicit cast and you're using C++, use the verbose, more specific casts like static_cast<>. If you absolutely must, use reinterpret_cast<> instead of C-style casts to make it obvious where you're overriding type information.

4. Periodically try removing casts, especially reinterpret_cast<>, to see whether they're actually necessary—remove them if they are not.

</pedantry>

-- 
Chris Page - Dylan Programmer

  Open Source Dylan Compilers: <http://www.opendylan.org/>


 _______________________________________________
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

  • Follow-Ups:
    • Re: Bizarre x86 segment layout problem causing select() slowdown: solved, sort of
      • From: Laurence Harris <email@hidden>
References: 
 >Bizarre x86 segment layout problem causing select() slowdown (From: Dave Hayden <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: Eric Albert <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: Dave Hayden <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: John Daniel <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: Dave Hayden <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: John Daniel <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: Dave Hayden <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: John Daniel <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: John Daniel <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: Shawn Erickson <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: Dave Hayden <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: Eric Albert <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown (From: Dave Hayden <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown: solved, sort of (From: Dave Hayden <email@hidden>)
 >Re: Bizarre x86 segment layout problem causing select() slowdown: solved, sort of (From: Jonas Maebe <email@hidden>)

  • Prev by Date: Re: Help Regarding Xcode 2.4
  • Next by Date: Re: Help Regarding Xcode 2.4
  • Previous by thread: Re: Bizarre x86 segment layout problem causing select() slowdown: solved, sort of
  • Next by thread: Re: Bizarre x86 segment layout problem causing select() slowdown: solved, sort of
  • Index(es):
    • Date
    • Thread