octave-maintainers
[Top][All Lists]
Advanced

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

Re: Should xelem bounds-check (and reference-check) when debugging optio


From: Rik
Subject: Re: Should xelem bounds-check (and reference-check) when debugging options are on
Date: Tue, 24 Jun 2014 09:40:30 -0700

On 06/23/2014 11:54 AM, address@hidden wrote:
> Message: 2
> Date: Mon, 23 Jun 2014 12:06:06 -0600
> From: David Spies <address@hidden>
> To: address@hidden
> Subject: Re: Should xelem bounds-check (and reference-check) when
>       debugging       options are on?
> Message-ID:
>       <address@hidden>
> Content-Type: text/plain; charset="utf-8"
>
> Here's my proposed changeset for this (labeled "Added safety checks to
> Array::xelem"):
>
> http://hg.octave.org/octave-dspies/graph/
>
> Thanks,
> David
>
>
> On Fri, Jun 20, 2014 at 11:42 AM, David Spies <address@hidden> wrote:
>
>> > Hello,
>> >
>> > When constructing (or accessing) matrix elements, I'd like to be able to
>> > call a function which does bounds-checking (and in the case of assignment,
>> > reference-count-checking with an exception if there's more than one
>> > reference) only when debugging options are turned on.
>> >
>> > I'm proposing adding these checks to the xelem method instead of creating
>> > a new method for it.  I can't imagine why it's necessary to have a method
>> > that does "no checks of any kind ever! Not even when debugging!"
>> >
>> > What do people think of the idea?
>> >
>> > Thanks,
>> > David
>> >
>> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> <http://lists.gnu.org/archive/html/octave-maintainers/attachments/20140623/96909bf9/attachment.html>
6/24/14

David,

Since there have been a bunch of threads recently on Octave performance,
could you benchmark this change to see if there are any performance issues
in the ordinary case where BOUNDS_CHECKING is disabled?

Also, this might be just me so I'm CC'ing the maintainer's list, but I find
a disembodied scope operator odd.  For example:

{ return xelem (:: compute_index(i, j, dims (), false)); }

It seems better to connect the scope operator to the function compute_index
since you are asking the compiler to search for that function name and
signature in whatever scope it appears.

--Rik





reply via email to

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