This repository has been archived on 2019-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
s6-pa-tp/TP3/alloc_statique.c

20 lines
530 B
C
Raw Normal View History

2017-03-03 16:45:25 +00:00
#define SIZE 27500
int M[SIZE][SIZE];
int main() {
// 2.1.1
// Sur une machine de TP Astruc ça plante à partir de SIZE ≥ 1448,
// ce qui correspond à SIZE²×sizeof(int)/1024 = 1448²×4/1024 = 8190 KiB
int i, j;
for (i = 0; i < SIZE; i++) {
for (j = 0; j < SIZE; j++) {
M[i][j] = i + j;
}
}
// 2.2.2
// Avec une definition de M en globale, ça plante à partir de 27500 < SIZE ≤ 30000
// Ça dépend en fait de la quantité de RAM et de SWAP disponible
}