News for hackers. Stuff that matters.
Re:TruffleC: A C implementation on top of JVM (2014) by aardvark179 on Friday August 12, 2022 @05:41AM (#32436288)
It can be done in a few different ways. Native memory can be managed as plain native memory (under the hood you can use Unsafe to access that memory) but the real advantage is that pointers to many objects can be kept as managed pointers and not converted to a native value most of the time. For example Ruby C extensions often use VALUEs to refer to Ruby objects which are normally tagged pointers. In TruffleRuby we use ValueWrapper objects to represent these, and maintain a fast map between native values and these objects when necessary.

There are no comments on this comment yet.