Constants - crowlogic/arb4j GitHub Wiki

the Real and Complex types implement the Lockable interface which has a method called lock that calls the POSIX mprotect function to designate the memory region pointed to be the type as read-only which will cause a crash if anything attempts to modify the variables contents.

This is useful for tracking down problems where something like RealConstants or ComplexConstants is being modified by some buggy code, or an input variable is being modified where it shouldn't be. This is a high-performance way to implement immutability at a level closer to the hardware in Java