mie: update bluelib api usage
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include <blue/object/hashmap.h>
|
||||
#include <blue/ds/hashmap.h>
|
||||
#include <mie/ir/const.h>
|
||||
#include <mie/ir/data.h>
|
||||
#include <mie/ir/func.h>
|
||||
@@ -116,30 +116,36 @@ static void cleanup(struct mie_value *value)
|
||||
{
|
||||
struct mie_module *module = MIE_MODULE(value);
|
||||
|
||||
b_queue_iterator it;
|
||||
b_queue_iterator_begin(&module->m_records, &it);
|
||||
while (b_queue_iterator_is_valid(&it)) {
|
||||
struct mie_value *v = b_unbox(struct mie_value, it.entry, v_entry);
|
||||
b_queue_iterator_erase(&it);
|
||||
b_queue_entry *entry = b_queue_first(&module->m_records);
|
||||
b_queue_entry *next = NULL;
|
||||
while (entry) {
|
||||
struct mie_value *v = b_unbox(struct mie_value, entry, v_entry);
|
||||
next = b_queue_next(entry);
|
||||
b_queue_delete(&module->m_records, entry);
|
||||
mie_value_destroy(v);
|
||||
entry = next;
|
||||
}
|
||||
|
||||
b_queue_iterator_begin(&module->m_types, &it);
|
||||
while (b_queue_iterator_is_valid(&it)) {
|
||||
struct mie_value *v = b_unbox(struct mie_value, it.entry, v_entry);
|
||||
b_queue_iterator_erase(&it);
|
||||
entry = b_queue_first(&module->m_types);
|
||||
while (entry) {
|
||||
struct mie_value *v = b_unbox(struct mie_value, entry, v_entry);
|
||||
next = b_queue_next(entry);
|
||||
b_queue_delete(&module->m_types, entry);
|
||||
mie_value_destroy(v);
|
||||
entry = next;
|
||||
}
|
||||
|
||||
b_queue_iterator_begin(&module->m_func, &it);
|
||||
while (b_queue_iterator_is_valid(&it)) {
|
||||
struct mie_value *v = b_unbox(struct mie_value, it.entry, v_entry);
|
||||
b_queue_iterator_erase(&it);
|
||||
entry = b_queue_first(&module->m_func);
|
||||
while (entry) {
|
||||
struct mie_value *v = b_unbox(struct mie_value, entry, v_entry);
|
||||
next = b_queue_next(entry);
|
||||
b_queue_delete(&module->m_func, entry);
|
||||
mie_value_destroy(v);
|
||||
entry = next;
|
||||
}
|
||||
|
||||
b_hashmap_release(module->m_data_strings);
|
||||
b_hashmap_release(module->m_data);
|
||||
b_hashmap_unref(module->m_data_strings);
|
||||
b_hashmap_unref(module->m_data);
|
||||
}
|
||||
|
||||
const struct mie_value_type module_value_type = {
|
||||
|
||||
Reference in New Issue
Block a user