Skip to content

Commit b530172

Browse files
committed
fix: incorrect Decima HashMap generics
1 parent 91eb691 commit b530172

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

crates/libdecima/src/types/decima/manual_types.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use crate::assert_size;
2-
use std::any::Any;
31
use std::marker::PhantomData;
42
use std::slice;
53

@@ -12,7 +10,6 @@ pub struct Array<T> {
1210
pub capacity: u32,
1311
pub entries: *mut T,
1412
}
15-
// assert_size!(Array<dyn Any>, 16);
1613

1714
impl<T> Array<T> {
1815
pub fn slice(&self) -> &[T] {
@@ -29,14 +26,13 @@ impl<T> Array<T> {
2926
pub struct Ref<T> {
3027
pub ptr: *mut T,
3128
}
32-
// assert_size!(Ref<dyn Any>, 8);
3329

3430
#[derive(Debug, Clone)]
3531
#[repr(C)]
3632
pub struct StreamingRef<T> {
3733
pub ptr: *mut T,
3834
}
39-
// assert_size!(StreamingRef<dyn Any>, 8);
35+
4036

4137
#[derive(Debug, Clone)]
4238
#[repr(C)]
@@ -45,7 +41,6 @@ pub struct UUIDRef<T> {
4541
pub uuid: [u8; 16],
4642
pub marker: PhantomData<T>,
4743
}
48-
// assert_size!(UUIDRef<dyn Any>, 16);
4944

5045
// todo: reverse WeakPtr
5146
#[derive(Debug, Clone)]
@@ -54,11 +49,9 @@ pub struct WeakPtr<T> {
5449
pub unk: [u8; 32],
5550
pub marker: PhantomData<T>,
5651
}
57-
// assert_size!(WeakPtr<dyn Any>, 32);
5852

5953
#[allow(non_camel_case_types)]
6054
pub type cptr<T> = Ref<T>;
61-
// assert_size!(cptr<dyn Any>, 8);
6255

6356
#[derive(Debug, Clone)]
6457
#[repr(C)]
@@ -69,10 +62,8 @@ pub struct HashMapEntry<V> {
6962

7063
#[derive(Debug, Clone)]
7164
#[repr(C)]
72-
pub struct HashMap<K, V> {
73-
pub entries: *mut HashMapEntry<V>,
65+
pub struct HashMap<T> {
66+
pub entries: *mut HashMapEntry<T>,
7467
pub size: u32,
7568
pub capacity: u32,
76-
77-
pub key_marker: PhantomData<K>,
7869
}

crates/libdecima/src/types/rtti/symbols.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ pub struct ExportedSymbols {
9696
pub groups: Array<*mut ExportedSymbolGroup>,
9797
pub dependencies_unk1: Array<*const RTTI>,
9898
pub dependencies_unk2: Array<*const RTTI>,
99-
pub all_symbols: HashMap<*mut ExportedSymbol, u32>,
100-
pub type_symbols: HashMap<*const c_char, *mut ExportedSymbol>,
99+
pub all_symbols: HashMap<(*mut ExportedSymbol, u32)>,
100+
pub type_symbols: HashMap<(*const c_char, *mut ExportedSymbol)>,
101101
}

0 commit comments

Comments
 (0)