[Top][All Lists]

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

memory management and copy-constructors

From: en254
Subject: memory management and copy-constructors
Date: Mon, 29 May 2000 20:46:38 -0400 (EDT)

I'm trying to understand how to manage memory with
extension types to octave.

I know that octave keeps reference counters for built
in types, thus avoiding unnecessary copying.

I'm wondering if extension types need to duplicate
this functionality or if it is inherited from the
base octave classes.

I've taken a look at the copy-constructor in, but since it doesn't need to manage
dynamic memory, it doesn't reveal much

--------cut from ------------
octave_integer : public octave_base_value
  octave_integer (const octave_integer& s)
    : octave_base_value (), scalar (s.scalar) { }
--------cut from ------------

Additionally, if I put debug print statements in
the copy-constructor, I never see it used.

My question:

1 When is the copy-constructor used?

2 Do extension classes need to manage their own
  reference counting?

Andy Adler,                               address@hidden

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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