I 开发者_如何学JAVAhave noticed some of my Scala classes contain a field with the name bitmap$0 of type int. What is this?
That's where the initialization states for lazy vals are stored.  When you access a lazy val (or a nested object, which is equivalent), the compiler uses the bitmap field to determine whether it's already been evaluated.
When lazy vals are initialized, this field is also used for synchronization when the value is initialized.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论