1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
//! Owned `AssemblyRef` table representation.
//!
//! This module provides the [`crate::metadata::tables::assemblyref::owned::AssemblyRef`] struct
//! which contains fully resolved assembly reference metadata with owned data and resolved heap
//! references. This is the primary data structure for representing external assembly dependencies
//! in a usable form after the dual variant resolution phase.
//!
//! # Architecture
//!
//! The owned representation stores fully resolved data from the `AssemblyRef` metadata table,
//! including resolved string and blob heap references. This eliminates the need for heap
//! lookups during runtime access, providing immediate access to assembly reference metadata.
//!
//! # Key Components
//!
//! - [`crate::metadata::tables::assemblyref::owned::AssemblyRef`] - Main owned assembly reference structure
//! - [`crate::metadata::identity::Identity`] - Strong name identity information
//! - [`crate::metadata::tables::assemblyref::AssemblyRefHash`] - Assembly hash verification data
//! - [`crate::metadata::customattributes::CustomAttributeValueList`] - Custom attribute collection
//!
//! # Integration
//!
//! This module integrates with:
//! - [`crate::metadata::tables::assemblyref::raw`] - Raw table representation
//! - [`crate::metadata::identity`] - Strong name identity handling
//! - [`crate::metadata::customattributes`] - Custom attribute processing
//! - [`crate::metadata::token`] - Token-based metadata references
use AtomicU32;
use crate;
/// Represents a .NET assembly reference with fully resolved metadata and owned data
///
/// This structure contains the complete assembly reference information from the `AssemblyRef`
/// metadata table (0x23), with all heap references resolved to owned strings and byte arrays.
/// Unlike [`crate::metadata::tables::assemblyref::raw::AssemblyRefRaw`], this provides
/// immediate access to string data without requiring heap lookups.
///
/// # Assembly Reference Identity
///
/// An assembly reference's identity consists of:
/// - **Simple name**: The assembly name (e.g., "mscorlib", "System.Core")
/// - **Version**: Four-part version number (Major.Minor.Build.Revision)
/// - **Culture**: Localization culture (None for culture-neutral assemblies)
/// - **Public key or token**: Strong name verification data (optional)
/// - **Hash**: Optional hash value for assembly integrity verification
///
/// # Additional Metadata
///
/// This structure also includes data from related tables:
/// - **`AssemblyRefOS`**: Operating system compatibility information
/// - **`AssemblyRefProcessor`**: Processor architecture requirements
/// - **Custom attributes**: Additional metadata applied to the reference
///
/// # Thread Safety
///
/// This type is [`Send`] and [`Sync`]. Atomic fields (OS and processor data) can be
/// safely accessed and modified from multiple threads. Other fields are read-only
/// after construction and safe for concurrent access.
///
/// # References
/// - [ECMA-335 II.22.5](https://ecma-international.org/wp-content/uploads/ECMA-335_6th_edition_june_2012.pdf) - `AssemblyRef` table specification
/// - [ECMA-335 II.22.7](https://ecma-international.org/wp-content/uploads/ECMA-335_6th_edition_june_2012.pdf) - `AssemblyRefOS` table specification
/// - [ECMA-335 II.22.8](https://ecma-international.org/wp-content/uploads/ECMA-335_6th_edition_june_2012.pdf) - `AssemblyRefProcessor` table specification