[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
backward incompatible change for 64-bit indexing
From: |
John W. Eaton |
Subject: |
backward incompatible change for 64-bit indexing |
Date: |
Fri, 14 Jun 2013 13:29:09 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 |
Octave's binary file format does not handle 64-bit dimensions, so we
are limited to saving vectors with less than 2^31 elements.
Currently, the save_binary and read_binary functions in the
octave_value class hierarchy unconditionally read and write 32-bit
signed values for matrix dimensions. The file format does have a
10-byte header to identify the file, currently it is either Octave-1-L
or Octave-1-B (for little- and big-endian). This can change to
Octave-2- for files that have 64-bit matrix dimensions.
My proposal is to do the following:
* For versions of Octave built with --enable-64:
- write files with the Octave-2- format
- read either type of file
* For versions of Octave built without --enable-64:
- continue to write files with Octave-1- format
- attempt to read either type of file, only failing if a value
that has dimensions that are too large to store given the limits
of 32-bit integer dimensions.
Unfortunately, I see no good way to make this change in a backward
compatible way because the save_binary and load_binary funtions in the
derived octave_X_value classes will have to know whether they are
writing or reading version 2 files. This means that after the change,
all octave_value types that are defined in C++ will have to change to
handle the new function signatures.
Comments?
jwe
- backward incompatible change for 64-bit indexing,
John W. Eaton <=