Commit Graph

62 Commits

Author SHA1 Message Date
gingerBill
ea263b8cc5 Add runtime.map_exists_dynamic 2022-11-08 11:29:09 +00:00
gingerBill
45f0c812af Correct reflect.map_entry_info_slice 2022-11-08 11:21:45 +00:00
gingerBill
50e10ceb3b Correct hashing for map types 2022-11-08 01:20:08 +00:00
gingerBill
da774e3fd2 General modifications 2022-11-08 00:38:31 +00:00
gingerBill
bce62b98d4 Basic fmt printing for map 2022-11-07 23:32:59 +00:00
gingerBill
e914a8710d Basic get and set support for new map 2022-11-07 23:17:37 +00:00
gingerBill
c96e0afbf1 Begin work on implementing the new map internals 2022-11-07 23:02:21 +00:00
gingerBill
831620bfc4 Remove header cache code 2022-09-21 13:06:02 +01:00
gingerBill
ff97a73152 Reduce unnecessary map gets 2022-09-21 13:03:13 +01:00
gingerBill
769d8dd038 Simplify __get_map_header stuff 2022-09-21 12:13:05 +01:00
gingerBill
1d793ea338 Split header table data and the map pointer 2022-09-21 12:09:05 +01:00
gingerBill
3fb69d59bb Minor correction to __get_map_header 2022-09-17 17:48:38 +01:00
gingerBill
cd484979a8 General clean up minor with rearrangements and removing unneeded procedures 2022-09-17 15:09:39 +01:00
gingerBill
9e3ea92829 Inline many calls and delete unused procedures 2022-09-17 14:59:16 +01:00
gingerBill
c37de9459e Minor refactor of the dynamic_map_internal.odin stuff 2022-09-17 14:46:52 +01:00
gingerBill
fbf036a654 Wrap __dynamic_map_find for certain cases 2022-09-17 13:11:29 +01:00
gingerBill
bfe0ffd6e6 Minor clean up 2022-09-17 13:02:06 +01:00
gingerBill
8ee6bb5d4b Add contextless where possible in dynamic_map_internal.odin 2022-09-17 13:00:19 +01:00
gingerBill
7840c1b89f Change __dynamic_map_get and __dynamic_map_set to use separate parameters rather than take a singular struct 2022-09-17 12:48:12 +01:00
gingerBill
0428d5ae2e Catch missing areas of Map_Index usage 2022-09-17 12:27:34 +01:00
gingerBill
b967ae2739 Change internal map indices to use a distinct uint rather than just int 2022-09-17 12:21:23 +01:00
gingerBill
a903e5024c Chnage next_pow2 to ceil_to_pow2 2022-09-17 11:18:26 +01:00
gingerBill
0ff5ff6ff2 Use pow of two capacity for hash maps to allow for & (n-1) instead of % n 2022-09-12 21:22:45 +01:00
gingerBill
c97a8418dc Clean-up and unification for the allocation procedures 2022-08-08 12:23:19 +01:00
gingerBill
4aca9372a6 Improve resize call 2022-08-08 12:11:30 +01:00
Tetralux
fa2296a124 [runtime] Add builtin shrink for dynamic arrays and maps
Asks the allocator to shrink the backing allocation to the current __length__, or a capacity
of the user's choosing.

Returns `(did_shrink: bool, err: mem.Allocator_Error)`.

```
shrink(&array) // shrinks to len(array)
shrink(&array, N) // shrink to N capacity

shrink(&map) // shrinks down to len(map)
shrink(&map, N) // shrink to N capacity
```
2022-06-04 23:29:47 +00:00
gingerBill
802df73183 Remove unneeded call 2021-10-26 14:47:59 +01:00
gingerBill
c64674c39e Remove unnecessary asserts 2021-10-26 13:38:48 +01:00
gingerBill
d386563344 Correct issue with the generated map type internals; Simplify map rehash logic to utilize resize 2021-10-07 21:23:37 +01:00
gingerBill
e6d8fbf194 Add runtime.__get_map_header_runtime 2021-09-25 17:30:18 +01:00
gingerBill
868c923770 Make map internals more robust when using mem.nil_allocator() 2021-09-25 15:55:27 +01:00
gingerBill
720884e0f1 Strip even more semicolons if followed by a } or ) on the same line 2021-08-31 23:47:57 +01:00
gingerBill
251da264ed Remove unneeded semicolons from the core library 2021-08-31 22:21:13 +01:00
gingerBill
a5c31bbee0 Add map_insert which returns the pointer to inserted value 2021-08-29 11:45:11 +01:00
gingerBill
f0437a4242 Enforce core:builtin and core:intrinsics for imports 2021-08-21 13:44:16 +01:00
gingerBill
4d00c2b800 Allocator_Error.Mode_Not_Implemented; Minor improvement to map runtime procedures 2021-08-08 14:29:45 +01:00
gingerBill
9f8a63cb43 More minor stylization changes (remove unneeded parentheses) 2021-06-14 11:34:31 +01:00
gingerBill
f98c4d6837 Improve the Allocator interface to support returning Allocator_Error to allow for safer calls
Virtually all code (except for user-written custom allocators) should work as normal. Extra features will need to be added to make the current procedures support the `Allocator_Error` return value (akin to #optional_ok)
2021-04-19 12:31:31 +01:00
gingerBill
a60d22fefd Make trailing comma usage consistent 2021-03-13 21:18:07 +00:00
gingerBill
083cec6c88 Remove dead code 2021-03-06 16:11:54 +00:00
gingerBill
b727b6438b Minimize unneeded casts 2021-03-03 14:31:17 +00:00
gingerBill
79eb46bce3 Replace inline uses in the rest of core with #force_inline 2021-02-23 20:39:59 +00:00
gingerBill
aa93305015 Replace usage of inline proc with #force_inline proc in the core library 2021-02-23 16:14:47 +00:00
gingerBill
a1693c0184 Deprecate inline for in favour of #unroll for 2021-02-23 14:45:15 +00:00
gingerBill
5803fcc158 Revert function passes 2020-11-29 20:41:01 +00:00
gingerBill
f06f33872c Make 16 simple hasher cases for small types 2020-11-29 18:17:21 +00:00
gingerBill
57f5976ac1 Support map keys for simple compare types 2020-11-29 16:12:21 +00:00
gingerBill
1dfe0cdd1d Simplify hashing approach map 2020-11-29 15:50:29 +00:00
gingerBill
97c66c9c73 Add intrinsics.type_hasher_proc; Make map work with generic hasher procedure 2020-11-29 15:27:53 +00:00
gingerBill
085972bb2c Minor clean up 2020-11-29 14:31:42 +00:00