We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6299a7e commit c50cf65Copy full SHA for c50cf65
src/arch/x86_64/gdt.rs
@@ -1,8 +1,6 @@
1
// SPDX-License-Identifier: Apache-2.0
2
// Copyright 2020 Google LLC
3
4
-use core::mem::size_of;
5
-
6
bitflags::bitflags! {
7
// An extension of x86_64::structures::gdt::DescriptorFlags
8
struct Descriptor: u64 {
@@ -43,7 +41,7 @@ struct Pointer {
43
41
44
42
impl Pointer {
45
const fn new(gdt: &'static [Descriptor]) -> Self {
46
- let size = gdt.len() * size_of::<Descriptor>();
+ let size = core::mem::size_of_val(gdt);
47
Self {
48
limit: size as u16 - 1,
49
base: &gdt[0],
0 commit comments