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-02-04Guarded allocator: Document non-obvious initialization with MEM_new()Julian Eisel
Initialization with `MEM_new()` depends a lot on the initialization rules of C++, which are not obvious. Calling it with no arguments to be passed to the constructor may cause the resulting object to be implicitly 0 initialized (or parts of it). This can have an impact on performance sensitive code, so it's something to document. Alternatively we could enforce default initialization (as opposed to the value initalization that happens now), but this could cause uninitialized memory in a way that isn't obvious either. This is a possible source of bugs, so Jacques and I decided against it.
2022-01-31Cleanup: spelling in commentsCampbell Barton
2022-01-11Revert "Cleanup: remove declaration for removed function"Campbell Barton
This reverts commit aa363ec2ae9382c052f024284dcdb77ac495c177. The function still exists, this commit caused a warning with Clang So keep MEM_printmemlist_pydict.
2022-01-06Cleanup: remove declaration for removed functionCampbell Barton
2021-12-27Allocator: add missing includeJacques Lucke
The placement-new operator requires `#include <new>`. It is used in `MEM_new`.
2021-12-17Allocator: simplify using guarded allocator in C++ codeJacques Lucke
Using the `MEM_*` API from C++ code was a bit annoying: * When converting C to C++ code, one often has to add a type cast on returned `void *`. That leads to having the same type name three times in the same line. This patch reduces the amount to two and removes the `sizeof(...)` from the line. * The existing alternative of using `OBJECT_GUARDED_NEW` looks a out of place compared to other allocation methods. Sometimes `MEM_CXX_CLASS_ALLOC_FUNCS` can be used when structs are defined in C++ code. It doesn't look great but it's definitely better. The downside is that it makes the name of the allocation less useful. That's because the same name is used for all allocations of a type, independend of where it is allocated. This patch introduces three new functions: `MEM_new`, `MEM_cnew` and `MEM_delete`. These cover the majority of use cases (array allocation is not covered). The `OBJECT_GUARDED_*` macros are removed because they are not needed anymore. Differential Revision: https://developer.blender.org/D13502
2021-12-14Cleanup: reorganize doxygen modulesCampbell Barton
- Nest compositor pages under the compositor module - Nest GUI, DNA/RNA & externformats modules under Blender. - Remove modules from intern which no longer exist. - Add intern modules (atomic, eigen, glew-mx, libc_compat, locale, numaapi, rigidbody, sky, utfconv). - Use 'intern_' prefix for intern modules since some of the modules use generic terms such as locale & atomic.
2021-12-08Cleanup: Clang-Tidy modernize-redundant-void-argAaron Carlisle
2021-11-16Cleanup: document that `MEM_dupallocN` is NULL-safeSybren A. Stüvel
Add comment explaining `MEM_dupallocN` is NULL-safe, in that it returns NULL when it receives a NULL pointer. This is currently true for both implementations of the function (`MEM_lockfree_dupallocN` and `MEM_guarded_dupallocN`), and will be expected of other implementations as well. No functional changes.
2021-10-03Cleanup: spelling in commentsCampbell Barton
2021-08-12Cleanup: use C++ style comments for disabled codeCampbell Barton
2021-07-26Cleanup: spelling in commentsCampbell Barton
2021-07-13Cleanup: Use C99 format string for the SIZET_FORMAT macroJesse Yurkovich
All platforms support the proper format string and it's already used in various other places. Differential Revision: https://developer.blender.org/D11460
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-04-09Cleanup: use our own code style for doxy-gen comment blocksCampbell Barton
2021-03-24Cleanup: clang-tidy errors.Jeroen Bakker
2021-03-24Cleanup: remove stdio.h header from MEM_guardedalloc.hCampbell Barton
This was included for `FILE *` which isn't used in the header. Ref D10799
2021-03-18Cleanup: spellingCampbell Barton
2021-03-14CMake/guardedalloc: add header file to TEST_SRCAnkit Meel
2021-01-20Cleanup: remove extra in trailing asteriskCampbell Barton
Comment blocks not conforming to convention.
2021-01-15Use mmap() IO for reading uncompressed .blendsLukas Stockner
Instead of submitting tons of tiny IO syscalls, we can speed things up significantly by `mmap`ing the .blend file into virtual memory and directly accessing it. In my local testing, this speeds up loading the Dweebs file with all its linked files from 19sec to 10sec (on Linux). As far as I can see, this should be supported on Linux, OSX and BSD. For Windows, a second code path uses `CreateFileMapping` and `MapViewOfFile` to achieve the same result. Reviewed By: mont29, brecht Differential Revision: https://developer.blender.org/D8246
2021-01-05Cleanup: remove UNUSED(..) from public function declarationsCampbell Barton
This doesn't serve any purpose and can become out of sync with the function it's self without reporting warnings.
2020-11-20Cleanup: spellingCampbell Barton
2020-11-19Guarded allocator: Fix lock-free allocator testsSergey Sharybin
Previously the lock-free tests were actually testing guarded allocator because the main entry point of tests was switching allocator to the guarded one. There seems to be no allocations happening between the initialization sequence and the fixture's SetUp(), so easiest seems to be just to switch to lockfree implementation in the fixture's SetUp(). The test are passing locally, so the "should work" has high chance of actually being truth :) Differential Revision: https://developer.blender.org/D9584
2020-11-19Guarded allocator: Add safety around type changeSergey Sharybin
While it might not cover all possible abuse of API, it does provide basic checks against most obvious usage mistakes.
2020-11-19Guarded allocator: Add explicit switch to the lockfree implementationSergey Sharybin
Previously the only way to use lockfree implementation was to start executable and never switch to guarded allocator. Surely, it is not possible to switch implementation once any allocation did happen, but some tests are desired to test lock-free implementation of the allocator. Those tests did not operate properly because the main entry point of tests are forcing guarded allocator to help catching bugs. This change makes it possible for those tests to ensure they do operate on lock-free implementation. There is no functional changes here, preparing boilerplate for an upcoming work on the allocator tests themselves.
2020-11-10Animation: Expand unit tests for `BKE_fcurve_active_keyframe_index()`Sybren A. Stüvel
Expand unit test for `BKE_fcurve_active_keyframe_index()` to test edge cases better. This also introduces a new test macro `EXPECT_BLI_ASSERT()`, which can be used to test that an assertion fails successfully. No functional changes to actual Blender code.
2020-10-01Cleanup: avoid member access within null pointerAnkit Meel
While harmless, UBSan warns about this. Prefer offsetof where possible since it's more readable.
2020-09-19Cleanup: use parenthesis for if statements in macrosCampbell Barton
2020-09-17Tests: bundle tests for some modules in their own executablesBrecht Van Lommel
The ffmpeg, guardedalloc and blenlib are quite isolated and putting them in their own executable separate from blender_test is faster for development than linking the entire blender_tests executable. For Cycles, this also bundles all the unit tests into one executable. Ref T79958 Differential Revision: https://developer.blender.org/D8714
2020-09-15Fix T80774: (correction) keep MEM_init_memleak_detection call earlyCampbell Barton
2020-09-08Cleanup: consistent syntax for doxygen parametersCampbell Barton
Also use back-slash instead of '@'.
2020-08-27Clang Tidy: Fix warningHans Goudey
Fix readability-static-definition-in-anonymous-namespace in new code
2020-08-26Tests: fail automated tests on memory leaks and other internal errorsJacques Lucke
This adds a new `--debug-exit-on-error` flag. When it is set, Blender will abort with a non-zero exit code when there are internal errors. Currently, "internal errors" includes memory leaks detected by guardedalloc and error/fatal log entries in clog. The new flag is passed to Blender in various places where automated tests are run. Furthermore, the `--debug-memory` flag is used in tests, because that makes the verbose output more useful, when dealing with memory leaks. Reviewers: brecht, sergey Differential Revision: https://developer.blender.org/D8665
2020-08-12Cleanup: compiler warningsBrecht Van Lommel
2020-08-11Cleanup: GCC warning in guardedalloc_overflow_testCampbell Barton
2020-08-10Tests: move remaining gtests into their own module foldersBrecht Van Lommel
And make them part of the blender_test runner. The one exception is blenlib performance tests, which we don't want to run by default. They remain in their own executable. Differential Revision: https://developer.blender.org/D8498
2020-08-08Cleanup: remove redundant return parenthesisCampbell Barton
2020-08-07Cleanup: Fix reported clang-tidy code-style issues.Ray Molenkamp
This resolves `error: statement should be inside braces` in some windows specific code that previously was unchecked by clang-tidy.
2020-08-07Cleanup: Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule. This should be the final commit of the series of commits that addresses this particular rule. No functional changes.
2020-08-01Cleanup: use term init instead of initialize/initialiseCampbell Barton
The abbreviation 'init' is brief, unambiguous and already used in thousands of places, also initialize is often accidentally written with British spelling.
2020-07-25Allocator: fix build error with -Werror=format-securityJacques Lucke
2020-07-24Allocator: make leak detection work with static variablesJacques Lucke
When definining static variables that own memory, you should use the "construct on first use" idiom. Otherwise, you'll get a warning when Blender exits. More details are provided in D8354. Differential Revision: https://developer.blender.org/D8354
2020-07-10Cleanup: spellingCampbell Barton
2020-07-07Cleanup: add comment explaining operator deleteJacques Lucke
2020-07-07Guarded Allocator: add missing operator deleteJacques Lucke
This resolves warning C4291 on windows.
2020-07-03Clang-tidy: Enable braces-around-statements warningSebastian Parborg
2020-07-03Clang-Tidy: Enable readability-redundant-control-flowHans Goudey
2020-07-03Guarded allocator: Override placement new operatorSergey Sharybin
Allows to in-place construct objects which are using guarded allocator.