16 Commits

Author SHA1 Message Date
mlugg
51595d6b75
lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
Andrew Kelley
6261c13731 update codebase to use @memset and @memcpy 2023-04-28 13:24:43 -07:00
Motiejus Jakštys
543bee0adf std.BufSet.clone: fix key ownership
This was introduced in d1a46548349a902c30057b3ba66ebad9bc25bdd2: when a
BufSet clones the keys, it used to assign the new pointers to the old
struct. Fix that by assigning the pointers to the correct, i.e. the new,
struct.

This caused double-free when using arena allocator for the new struct,
also in the test case.
2022-03-01 13:28:47 -05:00
Motiejus Jakštys
d1a4654834 std.BufSet: add clone and cloneWithAllocator
Following how ArrayList and HashMap does things. This is useful when one
wants to, ahem, clone the BufSet.
2022-02-28 15:51:58 -05:00
Lee Cannon
85de022c56
allocgate: std Allocator interface refactor 2021-11-30 23:32:47 +00:00
Andrew Kelley
d29871977f remove redundant license headers from zig standard library
We already have a LICENSE file that covers the Zig Standard Library. We
no longer need to remind everyone that the license is MIT in every single
file.

Previously this was introduced to clarify the situation for a fork of
Zig that made Zig's LICENSE file harder to find, and replaced it with
their own license that required annual payments to their company.
However that fork now appears to be dead. So there is no need to
reinforce the copyright notice in every single file.
2021-08-24 12:25:09 -07:00
Martin Wickham
fc9430f567 Breaking hash map changes for 0.8.0
- hash/eql functions moved into a Context object
- *Context functions pass an explicit context
- *Adapted functions pass specialized keys and contexts
- new getPtr() function returns a pointer to value
- remove functions renamed to fetchRemove
- new remove functions return bool
- removeAssertDiscard deleted, use assert(remove(...)) instead
- Keys and values are stored in separate arrays
- Entry is now {*K, *V}, the new KV is {K, V}
- BufSet/BufMap functions renamed to match other set/map types
- fixed iterating-while-modifying bug in src/link/C.zig
2021-06-03 17:02:16 -05:00
Veikka Tuominen
fd77f2cfed std: update usage of std.testing 2021-05-08 15:15:30 +03:00
daurnimator
d4af35b3fe HashMap.put returns !void, not a !bool 2021-02-27 13:11:47 +02:00
Frank Denis
6c2e0c2046 Year++ 2020-12-31 15:45:24 -08:00
Sahnvour
575fbd5e35 hash_map: rename to ArrayHashMap and add new HashMap implementation 2020-09-02 00:17:50 +02:00
Andrew Kelley
4a69b11e74 add license header to all std lib files
add SPDX license identifier
copyright ownership is zig contributors
2020-08-20 16:07:04 -04:00
Andrew Kelley
632acffcbd update std lib to new hash map API 2020-07-05 21:11:42 +00:00
Benjamin Feng
b7a236d68e Convert a bunch of page_allocator to testing.allocator 2020-01-29 22:22:01 -06:00
Andrew Kelley
cb38bd0a14
rename std.heap.direct_allocator to std.heap.page_allocator
std.heap.direct_allocator is still available for now but it is marked
deprecated.
2019-11-25 17:25:06 -05:00
Andrew Kelley
ed36dbbd9c
mv std/ lib/
that's all this commit does. further commits will fix cli flags and
such.

see #2221
2019-09-25 23:35:41 -04:00