mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: prerequisite changes for upcoming map update
This commit is contained in:
parent
99398ba652
commit
b750f1d1bb
@ -59,6 +59,14 @@ mut:
|
|||||||
value voidptr
|
value voidptr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Dynamic array with very low growth factor
|
||||||
|
struct DenseArray {
|
||||||
|
mut:
|
||||||
|
data &KeyValue
|
||||||
|
cap u32
|
||||||
|
size u32
|
||||||
|
}
|
||||||
|
|
||||||
fn new_map(n, value_bytes int) map {
|
fn new_map(n, value_bytes int) map {
|
||||||
probe_hash_bytes := sizeof(u32) * init_capicity
|
probe_hash_bytes := sizeof(u32) * init_capicity
|
||||||
key_value_bytes := sizeof(KeyValue) * init_capicity
|
key_value_bytes := sizeof(KeyValue) * init_capicity
|
||||||
|
@ -401,7 +401,7 @@ fn (v &V) type_definitions() string {
|
|||||||
mut types := []Type // structs that need to be sorted
|
mut types := []Type // structs that need to be sorted
|
||||||
mut builtin_types := []Type // builtin types
|
mut builtin_types := []Type // builtin types
|
||||||
// builtin types need to be on top
|
// builtin types need to be on top
|
||||||
builtins := ['string', 'array', 'map', 'Option']
|
builtins := ['string', 'array', 'KeyValue', 'DenseArray', 'map', 'Option']
|
||||||
for builtin in builtins {
|
for builtin in builtins {
|
||||||
typ := v.table.typesmap[builtin]
|
typ := v.table.typesmap[builtin]
|
||||||
builtin_types << typ
|
builtin_types << typ
|
||||||
|
Loading…
x
Reference in New Issue
Block a user