nrgraham23 / LibJFabric

Java bindings for libfabric.
2 stars 0 forks source link

All buffers must be direct buffers. Add checks to verify this. #46

Open nrgraham23 opened 8 years ago

nrgraham23 commented 8 years ago

Non-blocking calls must use direct buffers. The JVM may move arrays around as part of its memory management tasks, if an array being used in the C code is moved to another memory location, an error will occur. Direct buffers are allocated outside of the normal garbage collected heap, and thus will not be moved by the JVM.

Before these bindings are released for public use, an assert should be added to any method using a buffer to verify that the buffer is direct. See 481bec5 as an example of how this would be done.