aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-05-01 06:15:58 -0400
committerAndrew Kelley <andrew@ziglang.org>2020-05-01 06:47:56 -0400
commit87668211578b843571d6819fddde944328a05f89 (patch)
tree68cfe7fcdeaab2fef3d56260c23e0d965a056d56 /src/tokenizer.cpp
parent1d202008d8008681988effdf25be2c6a753cf067 (diff)
downloadzig-87668211578b843571d6819fddde944328a05f89.tar.gz
zig-87668211578b843571d6819fddde944328a05f89.zip
rework std.math.big.Int
Now there are 3 types: * std.math.big.int.Const - the memory is immutable, only stores limbs and is_positive - all methods operating on constant data go here * std.math.big.int.Mutable - the memory is mutable, stores capacity in addition to limbs and is_positive - methods here have some Mutable parameters and some Const parameters. These methods expect callers to pre-calculate the amount of resources required, and asserts that the resources are available. * std.math.big.int.Managed - the memory is mutable and additionally stores an allocator. - methods here perform the resource calculations for the programmer. - this is the high level abstraction from before Each of these 3 types can be converted to the other ones. You can see the use case for this in the self-hosted compiler, where we only store limbs, and construct the big ints as needed. This gets rid of the hack where the allocator was optional and the notion of "fixed" versions of the struct. Such things are now modeled with the `big.int.Const` type.
Diffstat (limited to 'src/tokenizer.cpp')
0 files changed, 0 insertions, 0 deletions