help-octave
[Top][All Lists]
Advanced

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

Re: Memory exaustion or size too large for index


From: Jaroslav Hajek
Subject: Re: Memory exaustion or size too large for index
Date: Thu, 25 Feb 2010 14:54:36 +0100

2010/2/25 José Luis García Pallero <address@hidden>:
> 2010/2/25 Jaroslav Hajek <address@hidden>:
>> On Thu, Feb 25, 2010 at 1:32 PM, Carlo de Falco <address@hidden> wrote:
>>>
>>> On 25 Feb 2010, at 13:17, Jaroslav Hajek wrote:
>>>
>>>>
>>>> Interesting, this works for me. What is the value of SIZEOF_LONG on your
>>>> system?
>>>
>>> #include <octave/oct.h>
>>> #include <iostream>
>>>
>>> int main ()
>>> {
>>>  std::cout << SIZEOF_LONG << std::endl;
>>>  return (0);
>>> }
>>>
>>> returns
>>>
>>> $ /opt/octave/3.3/bin/mkoctfile --link-stand-alone prova.cc
>>> $ ./a.out
>>> 4
>>>
>>>> Can you figure out the typedef of size_t on your platform?
>>>
>>> any hint where to look?
>>>
>>> c.
>>>
>>
>> Usually it's deep in *** somewhere in the gcc install directory
>> /usr/lib/gcc/*/include
>> I thought it's figured out by configure but it doesn't seem so.
>> Instead you can use template&macro magic to find out:
>>
>> #include <iostream>
>> #include <cstddef>
>>
>> #define PICK(TYPE) void pick(TYPE) { std::cout << #TYPE << '\n'; }
>> PICK(unsigned int)
>> PICK(unsigned long)
>> PICK(unsigned long long)
>> int main ()
>> {
>>  pick (size_t ());
>> }
>>
>> I expect you get "unsigned long long", right?
>>
>> --
>> RNDr. Jaroslav Hajek, PhD
>> computing expert & GNU Octave developer
>> Aeronautical Research and Test Institute (VZLU)
>> Prague, Czech Republic
>> url: www.highegg.matfyz.cz
>>
>> _______________________________________________
>> Help-octave mailing list
>> address@hidden
>> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>>
>
> But, if size_t would be changed to use unsigned long long as 64 bits
> integer. Can be managed in a 32 bits system a memory direction greater
> than 2 GB? I suppose that, internally, in Octave a C++ sentence as
> matrix[memDir] must be executed, with memDir > 2 GB in this case.
>
> --
> *****************************************
> José Luis García Pallero
> address@hidden
> (o<
> / / \
> V_/_
> Use Debian GNU/Linux and enjoy!
> *****************************************
>

No, with a 32-bit system, handling > 2GB arrays correctly is out of
question even though a total memory of > 2GB can be handled by a
system using things like PAE. However, the point is that Octave can
handle > 2GB arrays with 32-bit indexing, as long as the number of
elements is less than INT_MAX.

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

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