This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: uslurp change


Mike Cvet wrote:
Code in frysk-sys/proc/cni/slurp.cxx : uslurp which previously was:

 int fd = ::open (file, O_RDONLY);
 if (errno != 0) {
    ::free(buf);
    return NULL;

Has been changed to replicate behaviour seen in FileDescriptor.cxx where, if the maximum number of file descriptors has been reached, the garbage collector will be continually prodded until some descriptors get freed up.

Mike

uslurp is a "special case" function for /proc/$$/maps which can be large. It does the realloc dance on multiple 4k page reads while slurp just reads one page from /proc. The older slurp still does the vast majority of reads from /proc, so this optimization will be needed there to. I cannot think of a reason why I just did not replace uslurp with slurp many moons ago, but thinking about it, it probably should.

Regards

Phil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]