Commit graph

11 commits

Author SHA1 Message Date
Simon Hausmann
b4ba77dba7 Fix SharedVector creation from iterators with default size hints
* In capacity_for_grow, don't compare the number of elements
  (current_cap) with the size of an element in bytes, but
  with the required capacity instead (to detect that we don't need
  to grow). Not all call sites check for that (i.e. push), so there's
  a new test for that.

* When re-allocating due to growth and copying elements from the old
  inner to the new inner, make sure to copy all old elements from the beginning,
  not only the last element repeatedly.
2021-08-06 16:18:33 +02:00
Tobias Hunger
22c65707b2 Janitor: Fix clippy::len_zero 2021-08-04 22:50:35 +02:00
Tobias Hunger
60ef093aaa Janitor: Fix clippy::len_without_is_empty 2021-08-04 22:50:35 +02:00
Tobias Hunger
f1f0182826 Janitor: Fix clippy::needless_return 2021-07-30 09:27:48 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Tobias Hunger
13d7f5e7bd Janitor: Fix typos in comments and user-facing strings
Also adapt tests for error messages containing the fixed strings.

No behavior change is intended!
2021-06-28 08:32:25 +02:00
Olivier Goffart
ea0abe3031 Fix a few UB found by miri
An empty vector is not a `SharedVectorInner<T>`, it is a `SharedVectorInner<()>`
And so it is UB to take a reference of a `SharedVectorInner<T>` for the empty vector
2021-06-01 11:52:43 +02:00
Olivier Goffart
35cce45cbc Add a fii feature so that we don't compile in the ffi code if not required 2021-03-16 18:09:57 +01:00
Simon Hausmann
f087cc18bc Remove extern "C" functions from wasm module
We don't need these functions and their export. They account for ~20kb in
the optimized .wasm - plus JS glue code.
2021-02-26 17:04:49 +01:00
Simon Hausmann
b90eb04088 Begin with the brush data structure
This patch also adds `extend` to `SharedVector`, for convenience.
2021-02-01 14:45:49 +01:00
Olivier Goffart
dfa25b96f7 Rename SharedArray to SharedVector 2020-12-18 10:26:07 +01:00
Renamed from sixtyfps_runtime/corelib/sharedarray.rs (Browse further)