mirror of
https://github.com/odin-lang/Odin.git
synced 2026-03-06 16:47:03 +00:00
General modifications
This commit is contained in:
@@ -500,27 +500,10 @@ lbValue lb_generate_anonymous_proc_lit(lbModule *m, String const &prefix_name, A
|
||||
return value;
|
||||
}
|
||||
|
||||
// IMPORTANT NOTE(bill): This must match the definition in dynamic_map_internal.odin
|
||||
enum : i64 {
|
||||
MAP_CACHE_LINE_LOG2 = 6,
|
||||
MAP_CACHE_LINE_SIZE = 1 << MAP_CACHE_LINE_LOG2
|
||||
};
|
||||
GB_STATIC_ASSERT(MAP_CACHE_LINE_SIZE >= 64);
|
||||
void lb_map_cell_size_and_len(Type *type, i64 *size_, i64 *len_) {
|
||||
i64 elem_sz = type_size_of(type);
|
||||
|
||||
i64 len = 1;
|
||||
if (0 < elem_sz && elem_sz < MAP_CACHE_LINE_SIZE) {
|
||||
len = MAP_CACHE_LINE_SIZE / elem_sz;
|
||||
}
|
||||
i64 size = align_formula(elem_sz * len, MAP_CACHE_LINE_SIZE);
|
||||
if (size_) *size_ = size;
|
||||
if (len_) *len_ = len;
|
||||
}
|
||||
|
||||
LLVMValueRef lb_gen_map_cell_info(lbModule *m, Type *type) {
|
||||
i64 size = 0, len = 0;
|
||||
lb_map_cell_size_and_len(type, &size, &len);
|
||||
map_cell_size_and_len(type, &size, &len);
|
||||
|
||||
LLVMValueRef const_values[4] = {};
|
||||
const_values[0] = lb_const_int(m, t_uintptr, type_size_of(type)).value;
|
||||
|
||||
Reference in New Issue
Block a user