luaur_vm/records/
feedback_vector_slot.rs1use crate::enums::feedback_vector_slot_kind::FeedbackVectorSlotKind;
2
3#[allow(non_camel_case_types)]
4#[derive(Debug, Clone, Copy)]
5#[repr(C)]
6pub struct FeedbackVectorSlot {
7 pub kind: FeedbackVectorSlotKind,
8 pub data: FeedbackVectorSlotData,
9}
10
11#[allow(non_camel_case_types)]
12#[derive(Clone, Copy)]
13#[repr(C)]
14pub union FeedbackVectorSlotData {
15 pub call_target: FeedbackVectorSlotCallTarget,
16}
17
18#[allow(non_camel_case_types)]
19#[derive(Debug, Clone, Copy, Default)]
20#[repr(C)]
21pub struct FeedbackVectorSlotCallTarget {
22 pub pc: u32,
23 pub proto: u32,
24 pub hits: u32,
25}
26
27impl Default for FeedbackVectorSlot {
28 fn default() -> Self {
29 Self {
30 kind: FeedbackVectorSlotKind::CALL_TARGET,
31 data: FeedbackVectorSlotData {
32 call_target: FeedbackVectorSlotCallTarget::default(),
33 },
34 }
35 }
36}
37
38impl Default for FeedbackVectorSlotData {
39 fn default() -> Self {
40 unsafe { core::mem::zeroed() }
41 }
42}
43
44impl core::fmt::Debug for FeedbackVectorSlotData {
45 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
46 f.debug_struct("FeedbackVectorSlotData")
47 .field("call_target", unsafe { &self.call_target })
48 .finish()
49 }
50}