• 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: malloc was optimized out
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: malloc was optimized out


  • Subject: Re: malloc was optimized out
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 04 Jul 2016 23:36:42 -0700


On Jul 4, 2016, at 11:25 PM, Dmitry Markman <email@hidden> wrote:

what was confusing that debug build isn’t failing, only release build of our library crashes application

Does the real application make malloc calls of “ridiculous” sizes where malloc returns NULL? In that case the crash in the release build might have been because Clang decided to optimize away your tests for a NULL return value. In that case Clang’s optimizer is being wrong, but it’s probably best for you to preflight the size yourself and give up before calling malloc if the size is that big.

—Jens
 _______________________________________________
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

References: 
 >Re: malloc was optimized out (From: Dmitry Markman <email@hidden>)
 >Re: malloc was optimized out (From: Roland King <email@hidden>)
 >Re: malloc was optimized out (From: Dmitry Markman <email@hidden>)
 >Re: malloc was optimized out (From: Roland King <email@hidden>)
 >Re: malloc was optimized out (From: Jens Alfke <email@hidden>)
 >Re: malloc was optimized out (From: Dmitry Markman <email@hidden>)
 >Re: malloc was optimized out (From: David Duncan <email@hidden>)
 >Re: malloc was optimized out (From: Dmitry Markman <email@hidden>)

  • Prev by Date: Re: malloc was optimized out
  • Next by Date: Re: malloc was optimized out
  • Previous by thread: Re: malloc was optimized out
  • Next by thread: Re: malloc was optimized out
  • Index(es):
    • Date
    • Thread