This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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] |
Rainer> MappedByteBufferImpl *buf Rainer> = new MappedByteBufferImpl ((RawData *) ((char *) ptr + align), Rainer> size, mmode == 'r'); Rainer> - if (ptr == MAP_FAILED) Rainer> + if (ptr == (void *) MAP_FAILED) Rainer> throw new IOException (JvNewStringLatin1 (strerror (errno))); Rainer> buf->implPtr = reinterpret_cast<RawData*> (ptr); Rainer> buf->implLen = size+align;
... why are we checking `ptr' after creating the new MappedByteBufferImpl? It seems more efficient and correct to check first.
That is Per's code. Her is probably a better person to ask.
No reason that I can think of. While I don't think it matters, it certainly does seem cleaner to check ptr first. So feel free to change it. -- --Per Bothner per@bothner.com http://per.bothner.com/
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |