Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!llslave.llan.ll.mit.edu!53ab2750!not-for-mail
Newsgroups: comp.soft-sys.matlab
Subject: Re: Pass by Reference?
References: <ef386cf.-1@webcrossing.raydaftYaTP>
From: Peter Boettcher <boettcher@ll.mit.edu>
Message-ID: <m3wtc0y3lx.fsf@coyote.llan.ll.mit.edu>
Organization: MIT Lincoln Laboratory
User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.4 (gnu/linux)
Cancel-Lock: sha1:pBE2ohk1c902UpD0wyb3CEBwYkg=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 16
Date: Thu, 01 Jun 2006 17:20:58 -0400
NNTP-Posting-Host: 155.34.163.111
X-Complaints-To: news@ll.mit.edu
X-Trace: llslave.llan.ll.mit.edu 1149196858 155.34.163.111 (Thu, 01 Jun 2006 17:20:58 EDT)
NNTP-Posting-Date: Thu, 01 Jun 2006 17:20:58 EDT
Xref: news.mathworks.com comp.soft-sys.matlab:352977



"Brandon Aubie" <brandon.aubie@TAKETHISOUTelecore.com> writes:

> Hi,
>
> Is there a "proper" way to pass objects by reference? We need to
> pass a large object around NUMEROUS times (ie, >10000) and it's
> very slow. Passing by reference would speed this up tremendously.

Simply passing it around (and accessing it) is not slow.  No copy is
done, and pass-by-reference is indeed the internal implementation.  If
you start modifying the object, then the data is copied.

-- 
Peter Boettcher <boettcher@ll.mit.edu>
MIT Lincoln Laboratory
MATLAB FAQ: http://www.mit.edu/~pwb/cssm/