読者です 読者をやめる 読者になる 読者になる

メモリサイズ numpy 32 & 64 bit

Numpy array : http://docs.scipy.org/doc/numpy/user/basics.types.html
Numpy scaler: http://docs.scipy.org/doc/numpy/reference/arrays.scalars.html
Numpy C-API : http://docs.scipy.org/doc/numpy/reference/c-api.dtype.html
System dependence: http://docs.scipy.org/doc/numpy/reference/c-api.config.html


Cのdata-typeは、こちら(http://mixmemo.blogspot.jp/2009/09/linux-3264_23.html)から拝借したコードで調べられます。

#include <stdio.h>
#include <wchar.h>

int main()
{
  printf("int = %d\n", sizeof(int));
  printf("int* = %d\n", sizeof(int*));
  printf("void* = %d\n", sizeof(void*));
  printf("long int = %d\n", sizeof(long int));
  printf("long = %d\n", sizeof(long));
  printf("long long = %d\n", sizeof(long long));
  printf("short int = %d\n", sizeof(short int));
  printf("float = %d\n", sizeof(float));
  printf("double = %d\n", sizeof(double));
  printf("char = %d\n", sizeof(char));
  printf("wcahr_t = %d\n", sizeof(wchar_t));
}

Ubuntu 13.04 64bit

% gcc test.c
% ./a.out
int = 4
int* = 8
void* = 8
long int = 8
long = 8
long long = 8
short int = 2
float = 4
double = 8
char = 1
wcahr_t = 4

(sudo aptitude install gcc-multilib)

% gcc -m32 test.c
% ./a.out
int = 4
int* = 4
void* = 4
long int = 4
long = 4
long long = 8
short int = 2
float = 4
double = 8
char = 1
wcahr_t = 4