Jacques Lucke
9c9ea37770
Fix: Use a minimal alignment of 8 in MEM_lockfree_mallocN_aligned
...
`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
2020-01-23 14:21:48 +01:00
Campbell Barton
e12c08e8d1
ClangFormat: apply to source, most of intern
...
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
2019-04-17 06:21:24 +02:00
Campbell Barton
ab5e69e660
Cleanup: remove contributors for CMake files
...
Following removal from C source code.
See: 8c68ed6df1
2019-02-05 09:10:32 +11:00
Campbell Barton
af36dd4664
Cleanup: trailing newlines
2018-06-29 08:02:49 +02:00
Brecht Van Lommel
a6700362c7
Memory: add MEM_malloc_arrayN() function to protect against overflow.
...
Differential Revision: https://developer.blender.org/D3002
2018-01-17 19:59:47 +01:00
Sergey Sharybin
030e99588d
Tests: Use proper order for EXPECT_EQ()
2017-02-03 12:03:59 +01:00
Sergey Sharybin
2dba2b3d71
Fix gtests on Windows/MSVC
...
There were some missing stubs and some tests were specifically
written for Linux. Also, apparently MSVC has a limit of 64K for
the insource strings..
2016-02-06 21:21:55 +05:00
Sergey Sharybin
5508cc2d63
Fix typo in 32bytes aligned malloc test
2016-02-06 16:42:19 +01:00
Campbell Barton
8df6769040
CMake: update source files
2014-06-28 23:17:11 +10:00
Campbell Barton
7ecc3f4734
Add brief license headers to tests
...
These are effectively public-domain, but use apache2.0 to avoid adding new licenses
2014-06-19 18:48:41 +10:00
Sergey Sharybin
a6e58cd761
Use Blender codestyle, not Google's one!
2014-06-19 12:47:56 +06:00
Sergey Sharybin
16d64a99b4
Add unit tests for aligned alloc
...
This was really handy on initial work of aligned alloc
and would be handy as well when we'll need to support
arbitrary alignment on Apple platforms.
2014-06-19 12:45:00 +06:00