8 Commits

Author SHA1 Message Date
LemonBoy
482424e2b1 std: Handle empty MultiArrayList in items()
Closes #8211
2021-03-12 00:17:35 +01:00
Veikka Tuominen
9cd038d73a std: fix memory leak in MultiArrayList 2021-03-05 10:52:40 -08:00
Veikka Tuominen
904f774563 translate-c: fix c tokenizer giving invalid tokens 2021-03-03 11:33:14 -08:00
Andrew Kelley
38441b5eab MultiArrayList: use @memcpy as a workaround
Reverts bf642204b373e01314ecfb0c50a643dc4b05746f and uses a different
workaround, suggested by @LemonBoy.

There is either a compiler bug or a design flaw somewhere around here.
It does not have to block this branch, but I need to understand exactly
what's going on here and make it so that nobody ever has to run into
this problem again.
2021-02-24 12:49:12 -07:00
Andrew Kelley
bf642204b3 std.MultiArrayList: add workaround for LLVM bug 2021-02-23 22:24:59 -07:00
Andrew Kelley
cf42ae178d std.MultiArrayList: use @memset builtin for undefined
See comment for more details
2021-02-05 15:45:33 -07:00
Isaac Freund
0b4bb9b84f std.MultiArrayList: implement review comments 2021-02-05 10:51:45 -08:00
Andrew Kelley
0808d98e10 add std.MultiArrayList
Also known as "Struct-Of-Arrays" or "SOA". The purpose of this data
structure is to provide a similar API to ArrayList but instead of
the element type being a struct, the fields of the struct are in N
different arrays, all with the same length and capacity.

Having this abstraction means we can put them in the same allocation,
avoiding overhead with the allocator. It also saves a tiny bit of
overhead from the redundant capacity and length fields, since each
struct element shares the same value.

This is an alternate implementation to #7854.
2021-01-30 20:12:13 -07:00