Fossil SCM
Fixed "integer constant is too large for long type" warning on 32-bit Linux
Commit
caf26817208a638a8d60923c1fcb253d8043f1203947e94c17459bf88b98a19a
Parent
3f193ba61011737…
1 file changed
+4
-4
+4
-4
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -459,22 +459,22 @@ | ||
| 459 | 459 | ** Memory limits should be enabled at startup, but then turned off |
| 460 | 460 | ** before starting subprocesses. |
| 461 | 461 | */ |
| 462 | 462 | void fossil_limit_memory(int onOff){ |
| 463 | 463 | #if defined(__unix__) |
| 464 | - static sqlite3_int64 origHeap = 10000000000; /* 10GB */ | |
| 465 | - static sqlite3_int64 origStack = 8000000; /* 8MB */ | |
| 464 | + static sqlite3_int64 origHeap = 10000000000LL; /* 10GB */ | |
| 465 | + static sqlite3_int64 origStack = 8000000 ; /* 8MB */ | |
| 466 | 466 | struct rlimit x; |
| 467 | 467 | |
| 468 | 468 | #if defined(RLIMIT_DATA) |
| 469 | 469 | getrlimit(RLIMIT_DATA, &x); |
| 470 | 470 | if( onOff ){ |
| 471 | 471 | origHeap = x.rlim_cur; |
| 472 | 472 | if( sizeof(void*)<8 || sizeof(x.rlim_cur)<8 ){ |
| 473 | - x.rlim_cur = 1000000000; /* 1GB on 32-bit systems */ | |
| 473 | + x.rlim_cur = 1000000000 ; /* 1GB on 32-bit systems */ | |
| 474 | 474 | }else{ |
| 475 | - x.rlim_cur = 10000000000; /* 10GB on 64-bit systems */ | |
| 475 | + x.rlim_cur = 10000000000LL; /* 10GB on 64-bit systems */ | |
| 476 | 476 | } |
| 477 | 477 | }else{ |
| 478 | 478 | x.rlim_cur = origHeap; |
| 479 | 479 | } |
| 480 | 480 | setrlimit(RLIMIT_DATA, &x); |
| 481 | 481 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -459,22 +459,22 @@ | |
| 459 | ** Memory limits should be enabled at startup, but then turned off |
| 460 | ** before starting subprocesses. |
| 461 | */ |
| 462 | void fossil_limit_memory(int onOff){ |
| 463 | #if defined(__unix__) |
| 464 | static sqlite3_int64 origHeap = 10000000000; /* 10GB */ |
| 465 | static sqlite3_int64 origStack = 8000000; /* 8MB */ |
| 466 | struct rlimit x; |
| 467 | |
| 468 | #if defined(RLIMIT_DATA) |
| 469 | getrlimit(RLIMIT_DATA, &x); |
| 470 | if( onOff ){ |
| 471 | origHeap = x.rlim_cur; |
| 472 | if( sizeof(void*)<8 || sizeof(x.rlim_cur)<8 ){ |
| 473 | x.rlim_cur = 1000000000; /* 1GB on 32-bit systems */ |
| 474 | }else{ |
| 475 | x.rlim_cur = 10000000000; /* 10GB on 64-bit systems */ |
| 476 | } |
| 477 | }else{ |
| 478 | x.rlim_cur = origHeap; |
| 479 | } |
| 480 | setrlimit(RLIMIT_DATA, &x); |
| 481 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -459,22 +459,22 @@ | |
| 459 | ** Memory limits should be enabled at startup, but then turned off |
| 460 | ** before starting subprocesses. |
| 461 | */ |
| 462 | void fossil_limit_memory(int onOff){ |
| 463 | #if defined(__unix__) |
| 464 | static sqlite3_int64 origHeap = 10000000000LL; /* 10GB */ |
| 465 | static sqlite3_int64 origStack = 8000000 ; /* 8MB */ |
| 466 | struct rlimit x; |
| 467 | |
| 468 | #if defined(RLIMIT_DATA) |
| 469 | getrlimit(RLIMIT_DATA, &x); |
| 470 | if( onOff ){ |
| 471 | origHeap = x.rlim_cur; |
| 472 | if( sizeof(void*)<8 || sizeof(x.rlim_cur)<8 ){ |
| 473 | x.rlim_cur = 1000000000 ; /* 1GB on 32-bit systems */ |
| 474 | }else{ |
| 475 | x.rlim_cur = 10000000000LL; /* 10GB on 64-bit systems */ |
| 476 | } |
| 477 | }else{ |
| 478 | x.rlim_cur = origHeap; |
| 479 | } |
| 480 | setrlimit(RLIMIT_DATA, &x); |
| 481 |