Why is an int in OCaml only 31 bits?

后端 未结 5 906
感情败类
感情败类 2020-12-12 12:53

Haven\'t seen this \"feature\" anywhere else. I know that the 32nd bit is used for garbage collection. But why is it that way only for ints and not for the other basic types

5条回答
  •  既然无缘
    2020-12-12 13:20

    It's not exactly "used for garbage collection." It's used for internally distinguishing between a pointer and an unboxed integer.

提交回复
热议问题