Fossil SCM

Fixed "integer constant is too large for long type" warning on 32-bit Linux

andygoth 2017-06-24 16:28 trunk
Commit caf26817208a638a8d60923c1fcb253d8043f1203947e94c17459bf88b98a19a
1 file changed +4 -4
+4 -4
--- src/util.c
+++ src/util.c
@@ -459,22 +459,22 @@
459459
** Memory limits should be enabled at startup, but then turned off
460460
** before starting subprocesses.
461461
*/
462462
void fossil_limit_memory(int onOff){
463463
#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 */
466466
struct rlimit x;
467467
468468
#if defined(RLIMIT_DATA)
469469
getrlimit(RLIMIT_DATA, &x);
470470
if( onOff ){
471471
origHeap = x.rlim_cur;
472472
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 */
474474
}else{
475
- x.rlim_cur = 10000000000; /* 10GB on 64-bit systems */
475
+ x.rlim_cur = 10000000000LL; /* 10GB on 64-bit systems */
476476
}
477477
}else{
478478
x.rlim_cur = origHeap;
479479
}
480480
setrlimit(RLIMIT_DATA, &x);
481481
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button