patchGNU Octave - Patches: patch #10226, interpreter: Use static instead of...


patch #10226: interpreter: Use static instead of dynamic casts

Submitter:  John W. Eaton <jwe>
Submitted:  Wed 22 Jun 2022 01:44:07 PM UTC
Category:  Core : other Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup

Tue 28 Feb 2023 11:17:12 PM UTC, comment #3: 

I split the patch into two parts (one for the new configure option and another for the new DYNORSTAT_CAST macro) and applied them:

Then I made an additional change to rewrite expressions like

const octave_matrix& v = DYNORSTAT_CAST<const octave_matrix&> (a);


OCTAVE_CAST_BASE_VALUE (const octave_matrix&, v, a);

Closing as done but if someone has a better name for this new macro, let me know.

John W. Eaton <jwe>
Group administrator
Tue 28 Feb 2023 04:17:38 PM UTC, comment #2: 

This change was also posted in patch #10139 where there was some discussion.  Let's keep this report open since there is an updated patch here and close the other one.

The comments in the other patch item are primarily about whether static_cast will always be OK and whether using static or dynamic casts should be a configure option (it is in the current version of the patch) and what name should be used for any macro that allows easy switching between the two options.

John W. Eaton <jwe>
Group administrator
Tue 28 Feb 2023 11:38:43 AM UTC, comment #1: 

Updated patch attached. This needs patches new_30599 onwards to be applied in sequence first.

(file #54412)

Arun Giridhar <arungiridhar>
Group Member
Wed 22 Jun 2022 01:44:07 PM UTC, original submission:  

From Petter Tomner <petter>, extracted from the zip file attached to the following comment in the discourse thread "WIP stack VM f\
or Octave":

Change dynamic_cast to static_cast by default in operators, using
macro DYNORSTAT_CAST, to speed up interpreter.

New flag in configure script "--enable-internal-checks", to enable
expensive but useful checks for verification or debugging. With the

John W. Eaton <jwe>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #54412:  new_30608.patch added by arungiridhar (231KiB - text/x-patch)
file #53344:  octave_30608.patch added by jwe (231KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by arungiridhar (Updated the item)
  • -email is unavailable- added by jwe (Submitted the item)
  • -email is unavailable- added by jwe

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-02-28 jwe StatusNone Done
        Open/ClosedOpen Closed
    2023-02-28 arungiridhar Attached File- Added new_30608.patch, #54412
    2022-06-22 jwe Attached File- Added octave_30608.patch, #53344
        Carbon-Copy- Added petter

    Back to the top

    Powered by Savane 3.12