Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-28Fix wrong post-increment operators & test for BLI containersJulian Eisel
2022-05-25BLI: use no_unique_address attributeJacques Lucke
Even though the `no_unique_address` attribute has only been standardized in C++20, compilers seem to support it with C++17 already. This attribute allows reducing the memory footprint of structs which have empty types as data members (usually that is an allocator or inline buffer in Blender). Previously, one had to use the empty base optimization to achieve the same effect, which requires a lot of boilerplate code. The types that benefit from this the most are `Vector` and `Array`, which usually become 8 bytes smaller. All types which use these core data structures get smaller as well of course. Differential Revision: https://developer.blender.org/D14993
2022-05-20Cleanup: don't use variable name that matches type aliasJacques Lucke
2022-03-29BLI: optimize Map/Set/VectorSet.clear methodsJacques Lucke
Previously, those methods would destruct and reconstruct the data structure. While that was more simple in initial implementation, it has some downsides which are not resolved: * Already allocated memory is lost. So new memory would have to be allocated when the data structure is refilled. * The clearing process itself was slower because it did unnecessary work.
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2021-10-19BLI: Support removing keys from a set during iterationHans Goudey
This adds the ability to mark slots as removed while iterating through a mutable set. Differential Revision: https://developer.blender.org/D12867
2021-03-25BLI: fix Set.lookup_key_or_addJacques Lucke
2021-03-20BLI: improve support for generic algorithms with c++ containersJacques Lucke
Some generic algorithms from the standard library like `std::any_of` did not work with all container and iterator types. To improve the situation, this patch adds various type members to containers and iterators. Custom iterators for Set, Map and IndexRange now have an iterator category, which soe algorithms require. IndexRange could become a random access iterator, but adding all the missing methods can be done when it is necessary.
2020-11-05Spelling: Predefined, Look Up, No OneHarley Acheson
Fixes 18 misspellings of 'predefined', 'Look Up', 'Lookup', and 'No One'. Differential Revision: https://developer.blender.org/D9466 Reviewed by Hans Goudey
2020-10-12BLI: support looking up a key from a set or adding it when not existantJacques Lucke
2020-08-24BLI: improve exception safety of Set and MapJacques Lucke
For more information see rB2aff45146f1464ba8899368ad004522cb6a1a98c.
2020-08-07Cleanup: use C++ style casts in various placesJacques Lucke
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-07-20BLI: add typedefs for containers that use raw allocatorsJacques Lucke
Those are useful when you have to create containers with static storage duration. If those would use Blender's guarded allocator, it would report memory leaks, that are not actually leaks.
2020-07-20Refactor: Update integer type usageJacques Lucke
This updates the usage of integer types in code I wrote according to our new style guides. Major changes: * Use signed instead of unsigned integers in many places. * C++ containers in blenlib use `int64_t` for size and indices now (instead of `uint`). * Hash values for C++ containers are 64 bit wide now (instead of 32 bit). I do hope that I broke no builds, but it is quite likely that some compiler reports slightly different errors. Please let me know when there are any errors. If the fix is small, feel free to commit it yourself. I compiled successfully on linux with gcc and on windows.
2020-07-07Cleanup: remove redundant commentsJacques Lucke
Searching in these files for "_as" will reveal a comment at the top, that explains what these methods are for. There is no need to duplicate that knowledge all over the place.
2020-07-06BLI: add methods to lookup a stored key in a setJacques Lucke
2020-07-03Cleanup: add const in various placesJacques Lucke
2020-07-03Cleanup: Use trailing underscore for non-public data membersJacques Lucke
This makes the code conform better with our style guide.
2020-06-25Cleanup: spellingCampbell Barton
2020-06-13Cleanup: spellingCampbell Barton
2020-06-11Cleanup: fix terminology in commentJacques Lucke
2020-06-11BLI: fix printing name in print_stats methods of Map, Set and VectorSetJacques Lucke
2020-06-09BLI: rename ArrayRef to SpanJacques Lucke
This also renames `MutableArrayRef` to `MutableSpan`. The name "Span" works better, because `std::span` will provide similar functionality in C++20. Furthermore, a shorter, more concise name for a common data structure is nice.
2020-06-09BLI: put C++ data structures in "blender" namespace instead of "BLI"Jacques Lucke
We plan to use the "blender" namespace in other modules as well.
2020-06-09BLI: generally improve C++ data structuresJacques Lucke
The main focus here was to improve the docs significantly. Furthermore, I reimplemented `Set`, `Map` and `VectorSet`. They are now (usually) faster, simpler and more customizable. I also rewrote `Stack` to make it more efficient by avoiding unnecessary copies. Thanks to everyone who helped with constructive feedback. Approved by brecht and sybren. Differential Revision: https://developer.blender.org/D7931
2020-04-28BLI: add Set.clear methodJacques Lucke
2020-04-28BLI: add Set.is_empty methodJacques Lucke
2020-04-23BLI: various data structure improvementsJacques Lucke
* Rename template parameter N to InlineBufferCapacity * Expose InlineBufferCapacity parameter for Set and Map * Add some comments * Fixed an error that I introduced recently
2020-04-21BLI: Use .hh extension for C++ headers in blenlibJacques Lucke