Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
setrlimit & RLIMIT_DATA
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setrlimit & RLIMIT_DATA

This code:

  ierr = getrlimit(RLIMIT_AS,&limitstruct); CHKERR(ierr);
  printf("AS limit: soft=%d, hard=%d\n",
  limitstruct.rlim_cur = 1; limitstruct.rlim_max = 1;
  ierr = setrlimit(RLIMIT_AS,&limitstruct); CHKERR(ierr);
  ierr = getrlimit(RLIMIT_AS,&limitstruct); CHKERR(ierr);
  printf("limit: soft=%d, hard=%d\n",

  amt = 700000; printf("allocating %d\n",amt);
  ptr = (int*)malloc(amt*sizeof(int));
  for (i=0; i<amt; i++) ptr[i] = 2;

should bomb but doesn't. I found a 4-year old posting about this same bug in Darwin:

I guess this one is not high op Apple's priority list. Does anyone know a workaround?

Victor Eijkhout, 512 471 5809 (w), 512 499 0504 (h)
Texas Advanced Computing Center, The University of Texas at Austin

_______________________________________________ Do not post admin requests to the list. They will be ignored. Unix-porting mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

Visit the Apple Store online or at retail locations.

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.