diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-09-12 15:23:21 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-09-12 15:23:21 +0300 |
commit | 369d5e8ad2bb7c249c6b941779066b6aa99f9ea0 (patch) | |
tree | b0aece159472bfdc863832d8dc94666eba9a6327 /source/blender/blenlib/intern/BLI_timer.c | |
parent | 19547236355d59bc3888635ecbe4a9e35c1f86cb (diff) |
BLI: new C++ ArrayRef, Vector, Stack, ... data structures
Many generic C++ data structures have been developed in the
functions branch. This commit merges a first chunk of them into
master. The following new data structures are included:
Array: Owns a memory buffer with a fixed size. It is different
from std::array in that the size is not part of the type.
ArrayRef: References an array owned by someone else. All elements
in the referenced array are considered to be const. This should
be the preferred parameter type for functions that take arrays
as input.
MutableArrayRef: References an array owned by someone else. The
elements in the referenced array can be changed.
IndexRange: Specifies a continuous range of integers with a start
and end index.
IntrusiveListBaseWrapper: A utility class that allows iterating
over ListBase instances where the prev and next pointer are
stored in the objects directly.
Stack: A stack implemented on top of a vector.
Vector: An array that can grow dynamically.
Allocators: Three allocator types are included that can be used
by the container types to support different use cases.
The Stack and Vector support small object optimization. So when
the amount of elements in them is below a certain threshold, no
memory allocation is performed.
Additionally, most methods have unit tests.
I'm merging this without normal code review, after I checked the
code roughly with Sergey, and after we talked about it with Brecht.
Diffstat (limited to 'source/blender/blenlib/intern/BLI_timer.c')
0 files changed, 0 insertions, 0 deletions