forked from M-Labs/nac3
1
0
Fork 0

sizeof -> size_of

This commit is contained in:
lyken 2024-08-28 12:18:47 +08:00
parent a2937e1742
commit 9113093f9f
No known key found for this signature in database
GPG Key ID: 3BD5FC6AC8325DD8
2 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ pub trait Model<'ctx>: fmt::Debug + Clone + Copy + ModelBase<'ctx> {
}
/// Get the number of bytes of the [`BasicType`] of this model.
fn sizeof<G: CodeGenerator + ?Sized>(
fn size_of<G: CodeGenerator + ?Sized>(
&self,
generator: &mut G,
ctx: &'ctx Context,

View File

@ -202,7 +202,7 @@ impl<'ctx, Item: Model<'ctx>> Instance<'ctx, Ptr<Item>> {
num_items: IntValue<'ctx>,
) {
// Force extend `num_items` and `itemsize` to `i64` so their types would match.
let itemsize = self.model.sizeof(generator, ctx.ctx);
let itemsize = self.model.size_of(generator, ctx.ctx);
let itemsize = Int(Int64).z_extend_or_truncate(generator, ctx, itemsize);
let num_items = Int(Int64).z_extend_or_truncate(generator, ctx, num_items);
let totalsize = itemsize.mul(ctx, num_items);