Macintel: NIO considered harmful
Submitted by kebernet on Mon, 06/06/2005 - 19:52
Tagged:
And so it begins:
Just hours after announcing the migration of the Mac platform to Intel CPU's, Apple released the Universal Binary Programming Guidelines (PDF, 1.5 MB). This document points out the changes that must be made to code to ensure it runs on PowerPC and Intel-based Macs. One warning is of particular interest to Java developers, as it contains a warning for combining the java.nio package with JNI:Damnit. And I just started using NIO for my byte processing needs (and my ipod4j API :P). I am telling you, I don't care what Mathmatica runs on, this whole endian issue is going to be a big deal. And I don't care what Xcode does, until the GCC folks and people like Metroworks get the bugs worked out of compilers, it is going to be a while before this whole Intel thing is a Good Thing™. Anybody remember what the world was like in 10.0.0? Apple is basically sending the world back to that page for another year, maybe two.The I/O API (NIO) that was introduced in JDK 1.4 allows the use of native memory buffers. If you are a Java programmer who uses this API, you may need to revise your code. NIO byte buffers have a byte ordering which by default is big-endian. If you have Java code originally written for Mac OS X on PowerPC, when you create java.nio.ByteBuffers you should call the function ByteBuffer.order(ByteOrder.nativeOrder()) to set the byte order of the buffers to the native byte order for the current architecture. If you fail to do this, you will obtain flipped data when you read multibyte data from the buffer using JNI.Via java.net/mac sorry, no permalink available







Comments
RE: Macintel: NIO considered harmful
RE: Macintel: NIO considered harmful
RE: Macintel: NIO considered harmful