mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-24 06:01:33 +00:00
Use ordered IndexMap for exports in runtime-core
This commit is contained in:
@ -2,7 +2,7 @@ use crate::{
|
||||
global::Global, instance::InstanceInner, memory::Memory, module::ExportIndex,
|
||||
module::ModuleInner, table::Table, types::FuncSig, vm,
|
||||
};
|
||||
use std::collections::hash_map;
|
||||
use indexmap::map::Iter as IndexMapIter;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
@ -41,7 +41,7 @@ impl FuncPointer {
|
||||
|
||||
pub struct ExportIter<'a> {
|
||||
inner: &'a InstanceInner,
|
||||
iter: hash_map::Iter<'a, String, ExportIndex>,
|
||||
iter: IndexMapIter<'a, String, ExportIndex>,
|
||||
module: &'a ModuleInner,
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ pub struct ModuleInfo {
|
||||
pub imported_tables: Map<ImportedTableIndex, (ImportName, TableDescriptor)>,
|
||||
pub imported_globals: Map<ImportedGlobalIndex, (ImportName, GlobalDescriptor)>,
|
||||
|
||||
pub exports: HashMap<String, ExportIndex>,
|
||||
pub exports: IndexMap<String, ExportIndex>,
|
||||
|
||||
pub data_initializers: Vec<DataInitializer>,
|
||||
pub elem_initializers: Vec<TableInitializer>,
|
||||
|
@ -850,6 +850,7 @@ mod vm_ctx_tests {
|
||||
use crate::cache::Error as CacheError;
|
||||
use crate::typed_func::Wasm;
|
||||
use crate::types::{LocalFuncIndex, SigIndex};
|
||||
use indexmap::IndexMap;
|
||||
use std::any::Any;
|
||||
use std::collections::HashMap;
|
||||
use std::ptr::NonNull;
|
||||
@ -890,7 +891,7 @@ mod vm_ctx_tests {
|
||||
imported_tables: Map::new(),
|
||||
imported_globals: Map::new(),
|
||||
|
||||
exports: HashMap::new(),
|
||||
exports: IndexMap::new(),
|
||||
|
||||
data_initializers: Vec::new(),
|
||||
elem_initializers: Vec::new(),
|
||||
|
Reference in New Issue
Block a user