Age | Commit message (Collapse) | Author |
|
Comment blocks not conforming to convention.
|
|
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
|
|
This doesn't serve any purpose and can become out of sync
with the function it's self without reporting warnings.
|
|
|
|
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
|
|
While it might not cover all possible abuse of API, it does provide
basic checks against most obvious usage mistakes.
|
|
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.
|
|
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.
|
|
While harmless, UBSan warns about this.
Prefer offsetof where possible since it's more readable.
|
|
|
|
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
|
|
|
|
Also use back-slash instead of '@'.
|
|
Fix readability-static-definition-in-anonymous-namespace in new code
|
|
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
|
|
|
|
|
|
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
|
|
|
|
This resolves `error: statement should be inside braces` in some
windows specific code that previously was unchecked by clang-tidy.
|
|
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.
|
|
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
|
|
|
|
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
|
|
|
|
|
|
This resolves warning C4291 on windows.
|
|
|
|
|
|
Allows to in-place construct objects which are using guarded allocator.
|
|
'const' arrays couldn't use this macro with GNUC.
|
|
|
|
Previously this would be enabled when threads were used, but threads are now
basically always in use so there is no point. Further, this is only needed for
guarded allocation with --debug-memory which is not performance critical.
|
|
This helped to go beyond the 4GB limit, but is no longer relevant for 64 bit.
|
|
Usage of exception specifications is discouraged by the C++ core guidelines.
|
|
|
|
This was found with static analysis warnings in Visual Studio 2019.
Differential Revision: https://developer.blender.org/D6564
|
|
|
|
|
|
`posix_memalign` requires the `alignment` to be at least `sizeof(void *)`.
Previously, `MEM_mallocN_aligned` would simply return `NULL` if a too small
`alignment` was used. This was an OS specific issue.
The solution is to use a minimal alignment of `8` for all aligned allocations.
The unit tests have been extended to test more possible alignments (some
of which were broken before).
Reviewers: brecht
Differential Revision: https://developer.blender.org/D6660
|
|
|
|
|
|
|
|
|
|
When calling `MEM_guarded_mallocN_aligned` with an alignment of 4,
a pointer that was returned that is 4 byte but not 8 byte aligned.
When freeing this pointer, `MEM_guarded_freeN` thinks that it is an
illegal pointer, because it asserts that `((intptr_t)memh) & 0x7 == 0`.
The fix is to always use at least 8 byte alignment.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D5529
|
|
|
|
Previous cleanups didn't account for space after '#'.
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.
Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.
See T46725.
|