octave-maintainers
[Top][All Lists]
Advanced

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

Re: Pointers data type in Octave to handle data structures


From: Stefan van der Walt
Subject: Re: Pointers data type in Octave to handle data structures
Date: Thu, 23 Jun 2005 09:16:10 +0200
User-agent: Mutt/1.5.6i

On Wed, Jun 22, 2005 at 08:51:25PM -0400, Paul Kienzle wrote:
> Guillaume,
> 
> The lazy way is to simply return an int big enough to hold the pointer:
> 
>       if (sizeof(octave_int32_t) >= sizeof(void*))
>         return octave_value(static_cast<octave_int32_t>(ptr))
>     else
>         return octave_value(static_cast<octave_int64_t>(ptr))

I ask this in complete ignorance, but how does one guarantee that the
pointer data (ptr*) isn't re-allocated or overwritten by another part
of Octave or some other dynamic function?

Regards
Stéfan



reply via email to

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