Provide an implementation of the Array <T> implementation
- Dominant language
- C++
- Stars
- 406
- Forks
- 134
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 24
Description
An Array is a basic container that is using across Indigo.
Current implementation has the following issues or problems:
- `malloc`/`realloc` - based storatge without C++ lifetime guarantees
- basic move ctor without `noexceot`, and without move assignment
- size of `int` limits to 2Gb
- critical/blocker bugs such as:
1. `operator=(const Array&)` — copy-paste bug => for all `T != int` type it will keep copying through autogenerate assignment via shallow copy malloc- pointer -> double-free;
2. Array::memcmp — both branches of size-comparison return `-1`. Breaks any ordering over Array;
3. qsort/insertionSort uses char tmp[sizeof(T)] + memcpy for swap — UB for none-trivially-copyable T.
4. Global singleton _crc without Meyer's-pattern -> data race at a first access.
5. PROF_GET_NAME_INDEX uses sentinel 0, but index 0 valid -> every first label takes write-lock on every call/request.
6. volatile int _localMessage / void* volatile _localParam — volatile won't provide atomicity in C++11+;
7. ObjArray::push exception-unsafe: at `throw` in `ctor` — slot uninit, ~ObjArray calls ~T() on garbage.
- [ ] All bugs referred above fixed and not exist anymore in the new implementation.
- [ ] All `memcpy`/`memmove` - has `static_assert` or replaced with correct semantic that follows movable standard semantic.
- [ ] All necessary and important Unit-test are in place.
- [ ] Performance benchmark same as current or better.
- [ ] Compilation without any new warnings.
- [ ] All Integration test for .Net, Java, Python are passed without any kind of regression.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.