• 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: Simple Array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple Array


  • Subject: Re: Simple Array
  • From: Nicolai <email@hidden>
  • Date: Thu, 20 Sep 2001 19:04:30 +0200

But when I'm using NSArray it might be a bit slower.
In my source I will implement it, where I have to
access the array maybe 100.000.000 times.
So it has to be fast.
Am I right? Why shouldn't I use calloc an free?

Greetings, Nicolai.


First, DON'T DO THAT -- use NS(Mutable)Array instead.

If you insist, though, it is almost the same, but for the new/delete
operators which must be replaced by the standard ANSI malloc or calloc/free:

double * pDoubleArray;
pDoubleArray = calloc(size, sizeof(*pDoubleArray)); // sizeof(double) would
work as well, but this is better if you happen to change the source
pDoubleArray[position] = dNumber;
free(pDoubleArray);
pDoubleArray = NULL;
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


References: 
 >Re: Simple Array (From: Ondra Cada <email@hidden>)

  • Prev by Date: RE: division by zero not an error for cc?
  • Next by Date: Re: Aqua Interface Guidelines & Close Window location ?
  • Previous by thread: Re: Simple Array
  • Next by thread: Re: Simple Array
  • Index(es):
    • Date
    • Thread