RuedigerMoeller / fast-serialization

FST: fast java serialization drop in-replacement
Apache License 2.0
1.59k stars 245 forks source link

FSTBinaryOffheapMap Android support? #263

Open Wavesonics opened 6 years ago

Wavesonics commented 6 years ago

So it looks like the off heap map part of the library suffers from the same problem that the normal FST serialization stuff suffered from in the beginning: relying on the sun Unsafe class

Is there any chance we could get a similar solution that the Serialization stuff uses to get these working on Android?

Caused by: java.lang.NoSuchMethodError: No virtual method copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V in class Lsun/misc/Unsafe; or its super classes (declaration of 'sun.misc.Unsafe' appears in /system/framework/core-oj.jar)
        at org.nustaq.offheap.bytez.malloc.MallocBytez.getArr(MallocBytez.java:149)
        at org.nustaq.offheap.FSTSerializedOffheapMap.decodeValue(FSTSerializedOffheapMap.java:88)
        at org.nustaq.offheap.FSTCodedOffheapMap.get(FSTCodedOffheapMap.java:60)
RuedigerMoeller commented 6 years ago

one needs to back offheap map using bytebuffers. This is currently not implemented. Basically you need to have a ByteBuffer backed implementation for ByteSource