swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speed Question...


From: jalex
Subject: Re: Speed Question...
Date: Wed, 17 Nov 1999 09:38:15 -0800 (PST)

Darren Schreiber writes:
> I've never used a C array to store (id)'s, is that possible and is that
> what you are meaning?

Objective-C's variable type "id" is just a generic pointer.
Consequently, an array of id's can be declared using the standard C
syntax

  id an_array[ARRAY_SIZE];

with the memory required simply being ARRAY_SIZE * sizeof(id).  (I
believe sizeof(id) = 4 bytes, on most machines.)  If you don't need to
resize the array when the model runs, this is definitely the way to
go.  Why?  You can access any location in the array in constant time
(which is true for Swarm's Array class), and not incur the overhead
required for passing messages, as you do with Swarm's Array class.

Cheers,

Jason



                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]