densh / scala-offheap

Experimental type-safe off-heap memory for Scala.
BSD 3-Clause "New" or "Revised" License
532 stars 38 forks source link

Add an off-heap Option #100

Open adam-wyluda opened 8 years ago

adam-wyluda commented 8 years ago

It would work like one-element off-heap array. Option.empty would be just a null reference, otherwise it will point to address containing value of this Option.

The use case for this class is return value of some off-heap collection methods, such as find or get in Map.

adam-wyluda commented 8 years ago

Also the benefit of having an Option as a return type for methods, is that it can dereference primitive type values to memory instead of returning them directly, which effectively allows us to have null references of the primitives.

densh commented 8 years ago

Sounds good to me.