在编译的 Scala 中,bitmap$0 字段是什么? [英] In compiled Scala, what is the bitmap$0 field?

查看:34
本文介绍了在编译的 Scala 中,bitmap$0 字段是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到我的一些 Scala 类包含一个名为 bitmap$0 的字段,类型为 int.这是什么?

I have noticed some of my Scala classes contain a field with the name bitmap$0 of type int. What is this?

推荐答案

那是存储 lazy val 的初始化状态的地方.当您访问 lazy val(或嵌套的 object,等效的)时,编译器使用位图字段来确定它是否已经被评估.

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.

这篇关于在编译的 Scala 中,bitmap$0 字段是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆