• 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: NewPtr vs malloc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NewPtr vs malloc


  • Subject: Re: NewPtr vs malloc
  • From: "Tomas Zahradnicky, Jr." <email@hidden>
  • Date: Sat, 8 Dec 2001 23:07:19 +0100

However, all these have equivalents.
NewPtr = malloc
NewPtrClear = calloc
GetPtrSize = malloc_size
SetPtrSize = realloc
and MemError() is not needed as badly on a system with good virtual memory. If the pointer is nil, there is simply no memory to be had.

Sure, you may get memerror if your heap gets corrupted for example or if you pass bad handle into a system function.

As far as actual implementation details, NewPtr currently calls malloc and DisposePtr calls free and I would assume the other functions did the same.

Sure, you can use whichever you like. If you are used to use malloc, you may do so and the same for NewPtr :-)

-Tomas
--
# Tomas Zahradnicky, Jr
# The Czech Technical University
# FEL-CTU, Prague


References: 
 >Re: NewPtr vs malloc (From: Brendan Younger <email@hidden>)

  • Prev by Date: Re: NSBundle question
  • Next by Date: Re: monitoring file modifications
  • Previous by thread: Re: NewPtr vs malloc
  • Next by thread: Re: NewPtr vs malloc
  • Index(es):
    • Date
    • Thread