Skip to content

Commit 9370ebd

Browse files
jimpoVeykril
authored andcommitted
Remove Module::set_name
The implemented could leave a dangling reference to the module name after drop. Since proper implementation is sort of involved, we'll leave for a follow-up.
1 parent ec00493 commit 9370ebd

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/module.rs

-8
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ impl ParsedModule {
6666
pub struct Module<'rt> {
6767
raw: ffi::IM3Module,
6868
rt: &'rt Runtime,
69-
name_cstr: Vec<cty::c_char>,
7069
}
7170

7271
impl<'rt> Module<'rt> {
@@ -218,12 +217,6 @@ impl<'rt> Module<'rt> {
218217
unsafe { cstr_to_str(ffi::m3_GetModuleName(self.raw)) }
219218
}
220219

221-
/// Set the name of this module.
222-
pub fn set_name(&mut self, name: &str) {
223-
self.name_cstr = str_to_cstr_owned(name);
224-
unsafe { ffi::m3_SetModuleName(self.raw, self.name_cstr.as_ptr()) };
225-
}
226-
227220
/// Links wasi to this module.
228221
#[cfg(feature = "wasi")]
229222
pub fn link_wasi(&mut self) -> Result<()> {
@@ -236,7 +229,6 @@ impl<'rt> Module<'rt> {
236229
Module {
237230
raw,
238231
rt,
239-
name_cstr: Vec::new(),
240232
}
241233
}
242234
}

0 commit comments

Comments
 (0)