commit | c126937564121b7538bf14fb1e00b115932d09e2 | [log] [tgz] |
---|---|---|
author | Karl Wiberg <kwiberg@webrtc.org> | Mon Mar 02 19:23:41 2020 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Mar 02 20:45:58 2020 |
tree | d59b37fcb6691b34d7543a957bc10997a59b16ac | |
parent | f52d3ed084e30860bfecdc2dcbbc9c3919df779f [diff] |
BoundedInlineVector: Vector class of bounded size with inline allocation Selling point is that it never touches the heap. Intended use case is cheaply returning a variable, bounded, and small number of things from a function. Specifically, there are situations where we'd like to return things like ArrayView<ArrayView<float>> where we currently have to allocate an array of ArrayView<float> for the outer ArrayView to point to, which is a bother; however, although the outer ArrayView is of variable size, that size is statically guaranteed to not exceed some small constant. After this CL, we'll be able to instead return BoundedInlineVector<ArrayView<float>, kSmallConstant> which is much more convenient. We already had the option of returning e.g. std::vector<ArrayView<float>> but that would bloat our binary with code to handle heap allocations in places we'd rather be lean and mean. https://godbolt.org/z/r-vcPj demonstrates that the overhead compared to a raw C array + a size is ~zero. Bug: webrtc:11391 Change-Id: Ifb6d937193052588be641aa62cc67ba0ec64ded6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168944 Commit-Queue: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Per Ã…hgren <peah@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30663}
WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.
The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.
See http://www.webrtc.org/native-code/development for instructions on how to get started developing with the native code.
Authoritative list of directories that contain the native API header files.