~ubuntu-branches/ubuntu/vivid/gcl/vivid

« back to all changes in this revision

Viewing changes to o/alloc.c

  • Committer: Package Import Robot
  • Author(s): Camm Maguire
  • Date: 2014-05-16 17:41:33 UTC
  • mto: This revision was merged to the branch mainline in revision 62.
  • Revision ID: package-import@ubuntu.com-20140516174133-czs0uktsjj2vkhxk
2.6.11preĀ testĀ 11

Show diffs side-by-side

added added

removed removed

Lines of Context:
1030
1030
#if defined(BSD) && defined(RLIMIT_STACK)
1031
1031
  {
1032
1032
    struct rlimit rl;
1033
 
    unsigned long mss;
1034
1033
  
1035
1034
  /* Maybe the soft limit for data segment size is lower than the
1036
1035
   * hard limit.  In that case, we want as much as possible.
1041
1040
      massert(!setrlimit(RLIMIT_DATA, &rl));
1042
1041
    }
1043
1042
 
1044
 
    mss=rl.rlim_cur/64;
1045
1043
    massert(!getrlimit(RLIMIT_STACK, &rl));
1046
 
    if (rl.rlim_max != RLIM_INFINITY && rl.rlim_max < mss)
1047
 
      mss=rl.rlim_max;
1048
 
    if (rl.rlim_cur == RLIM_INFINITY || rl.rlim_cur != mss) {
1049
 
      rl.rlim_cur=mss;
1050
 
#ifdef __MIPS__
1051
 
      if (setrlimit(RLIMIT_STACK,&rl))
1052
 
        fprintf(stderr,"Cannot set stack rlimit\n");/*FIXME work around make bug on mips*/
1053
 
#else
 
1044
    if (rl.rlim_cur!=RLIM_INFINITY && (rl.rlim_max == RLIM_INFINITY || rl.rlim_max > rl.rlim_cur)) {
 
1045
      rl.rlim_cur = rl.rlim_max == RLIM_INFINITY ? rl.rlim_max : rl.rlim_max/64;
1054
1046
      massert(!setrlimit(RLIMIT_STACK,&rl));
1055
 
#endif
1056
1047
    }
1057
1048
    cssize = rl.rlim_cur/sizeof(*cs_org) - sizeof(*cs_org)*CSGETA;
1058
1049
  
1088
1079
 
1089
1080
  massert(getpagesize()<=PAGESIZE);
1090
1081
  memprotect_test_reset();
1091
 
  memory_protect(sgc_enabled ? 1 : 0);
 
1082
  if (sgc_enabled)
 
1083
    memory_protect(1);
1092
1084
 
1093
1085
#endif
1094
1086