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:49:04 +0100

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



reply via email to

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