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 13:58:23 +0100

On Thu, Feb 25, 2010 at 1:51 PM, Carlo de Falco <address@hidden> wrote:
>
> On 25 Feb 2010, at 13:49, Jaroslav Hajek wrote:
>
>>
>> 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?
>
> no:
>
> $ /opt/octave/3.3/bin/mkoctfile --link-stand-alone prova.cc
> $ ./a.out
> unsigned long
>
> c.
>

Ugh. How is this possible? Can you please try

#include <iostream>
#include <cstddef>
#define DUMPSIZE(TYPE) std::cout << "sizeof ("#TYPE") = " << sizeof
(TYPE) << '\n'
int main()
{
  DUMPSIZE(int);
  DUMPSIZE(unsigned int);
  DUMPSIZE(long);
  DUMPSIZE(unsigned long);
  DUMPSIZE(long long);
  DUMPSIZE(unsigned long long);
  DUMPSIZE(size_t);
  DUMPSIZE(ptrdiff_t);
  DUMPSIZE(void *);
}

It seems to me that in your case size_t is of size 4 and void * is of
size 8, which seems impossible.

-- 
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]