This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH] Use mmap for symbol tables


> So you'll have to check at runtime whether mmap is possible and if it
> fails fall back on the old code that simply reads the file.

My patch does that.  The compile time conditionals are, um, still in the
future, but the runtime check is, if mmap fails, act as though the call
had never occurred.  Disabling the mmap code through a runtime config
option is similar.  The trick is to not get rid of the fallback (the
original malloc/seek/read code); each chunk of the patch which adds a
call to mmap test the return value and falls through to the original
code if mmap fails.  The calling code doesn't care whether the mmap
syscall failed, or mmap wasn't even called because of a config option.

It wouldn't be all that hard to handle mmap failures by disabling mmap;
that would eliminate the overhead of repeated mmap failures (replace it
by the overhead of repeated checks of the runtime config option value; I
assume that overhead is negligible).


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