Skip to main content

luaur_vm/methods/
temp_buffer_temp_buffer_lvmload_alt_d.rs

1use crate::records::temp_buffer::TempBuffer;
2
3impl<T> Drop for TempBuffer<T> {
4    fn drop(&mut self) {
5        if !self.data.is_null() {
6            unsafe {
7                crate::functions::lua_m_free::luaM_free_(
8                    self.L,
9                    self.data as *mut core::ffi::c_void,
10                    self.count * core::mem::size_of::<T>(),
11                    0,
12                )
13            };
14            self.data = core::ptr::null_mut();
15            self.count = 0;
16        }
17    }
18}