Commit Graph

69 Commits

Author SHA1 Message Date
4b188bb08c Cleanup: use over-line for doxy comments
Follow our code style for doxygen sections.
2020-10-27 21:45:55 +11:00
3a7fd309fc Spelling: It's Versus Its
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.

Differential Revision: https://developer.blender.org/D9250

Reviewed by Campbell Barton
2020-10-19 08:12:33 -07:00
2115232a16 Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fix
No functional changes
2020-09-04 21:04:16 +02:00
2d1cce8331 Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
cd6b49f995 Cleanup: spelling 2019-07-07 15:38:41 +10:00
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
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
d805a4a5ef Cleanup: move fast heap into own source & header 2018-11-06 12:52:34 +11:00
29dfe9a614 Cleanup: style 2018-11-06 12:39:51 +11:00
fee6ab18e7 BLI_heap: implement a limited but faster version of heap.
If the user only needs insertion and removal from top, there is
no need to allocate and manage separate HeapNode objects: the
data can be stored directly in the main tree array.

This measured a 24% FPS increase on a ~50% heap-heavy workload.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3898
2018-11-05 20:49:17 +03:00
a70589e439 BLI_heap: optimize heap_swap, heap_down and heap_up.
The index field of nodes is supposed to be its actual index, so
there is no need to read it in swap. On a 64-bit processor i and
j are already in registers, so this removes two memory reads.

In addition, cache the tree pointer, use branch hints, and
put the most frequently accessed 'value' field at 0 offset.

Produced a 20% FPS improvement for a 50% heap-heavy workload.
2018-11-05 17:16:06 +03:00
d3c815bd08 BLI_heap: add an API function to directly read the top node value.
It is very commonly needed in loop conditions to check if
the items in the heap are good enough to continue.
2018-11-04 13:29:17 +03:00
a30c9f710a Partial revert '#if 0' cleanup
Partially revert 41216d5ad4

Some of this code had comments to be left as is for readability,
or comment the code should be kept.
Other functions were only for debugging.
2018-10-19 09:18:22 +11:00
41216d5ad4 Cleanup: Remove more #if 0 blocks
Continuation of https://developer.blender.org/D3802

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3808
2018-10-18 15:43:06 +02:00
af36dd4664 Cleanup: trailing newlines 2018-06-29 08:02:49 +02:00
ccdacf1c9b Cleanup: use '_len' instead of '_size' w/ BLI API
- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
  (hint this isn't a simple getter).

See P611 to apply instead of manually resolving conflicts.
2018-02-15 23:39:08 +11:00
512b879241 BLI_heap: add validation check, improve tests
Also minor readability changes, avoid running both heap_up/down
gives minor speedup too.
2017-10-29 18:23:33 +11:00
bd0d41059f Cleanup: move docs out of header 2017-10-29 16:08:10 +11:00
4518c0f3e8 Cleanup: const args 2017-10-29 15:47:10 +11:00
3425732926 BLI_heap: minor changes to the API
Recent addition of 'reinsert' didn't match logic for ghash API.

Rename to BLI_heap_node_value_update,
also add BLI_heap_insert_or_update since it's a common operation.
2017-10-29 15:47:06 +11:00
4af1af70ad BLI_hash: add BLI_heap_reinsert
Allows avoiding remove/insert calls.
2017-10-29 04:42:58 +11:00
8ac69ff9dc Cleanup: use uint type in BLI 2017-10-28 17:48:45 +11:00
b1d0432bb7 Fix strict compiler flags with older GCC 2016-08-01 18:01:27 +02:00
4e5ee5b75e Fix own error in recent heap update 2016-07-21 00:35:42 +10:00
c974def837 BLI_heap: replace memarena w/ local allocator
- Since element size its known it's less work to do inline.
- In test with high-poly model, gave ~9% overall speedup for decimate modifier.
2016-07-17 19:29:30 +10:00
c57d823683 Cleanup: minor edits to BLI_heap 2016-07-17 19:29:30 +10:00
559e1434d8 parenthisize macro args to avoid errors 2015-08-02 13:54:06 +10:00
d36429b930 initialize members in-order 2015-04-14 18:41:01 +10:00
83cbcefac8 Add edgehash remove, clear functions, Heap clear
Edgehash was missing removal functions (remove, popkey, clear),
since it wasn't needed so far, but is based on same code as ghash which has them.

also add heap clear() method so we can reuse heaps.

(needed for upcoming fix).
2014-12-09 00:32:20 +01:00
55812e3acd Cleanup: simplify heap popmin 2014-12-09 00:13:35 +01:00
03760fed0d Cleanup: remove unused pointer in Heap 2014-12-09 00:02:50 +01:00
c005fb407b Util-defines: avoid multiple calculation/access for MIN/MAX macros 2013-12-08 17:29:22 +11:00
e220d3228f add MEM_SIZE_OPTIMAL to avoid memory fragmentation & waste lost to slop-space. 2013-10-10 18:18:13 +00:00
2924a02a35 move strict compiler checks into a header so its easier to manage in one place (pragmas were copied around).
also enable more strict warnings for BLF (which had some incorrect casts).
2013-09-01 00:46:04 +00:00
c212503437 minor changes to BLI_heap, save some CPU cycles.
added an assert for incorrect use of BLI_heap_remove
2013-08-03 22:04:47 +00:00
418011907c remove nan copyrights from code added since blender become opensource (copy paste errors), also remove BKE_script.h 2013-07-02 10:14:59 +00:00
1fb980e7df reduce sign conversion comparisons for smallhash and tweak warnings elsewhere. 2013-06-22 20:20:06 +00:00
Dalai Felinto
d23bf09712 build fix for old gccs (after rev.57620)
enabling the new pragmas only when gcc >= 4.6
gcc 4.2.1 here (OSX)
2013-06-22 20:00:17 +00:00
2efea8cf03 reduce sign comparisons for ghash and add more strict warnings for gcc. 2013-06-20 19:39:29 +00:00
c721d82f25 move sort from vert/edge/face into mesh menu only (sorting isn't such a common operation).
correct own recently added assert.
2013-06-20 19:09:18 +00:00
998101763a correct for own regressions when refactoring select-path, was using heap popmin incorrectly. 2013-06-19 19:59:49 +00:00
3b341068ba warn of sign conversions for low level apis - ghash, heap, mempool 2013-05-08 12:55:51 +00:00
221a383366 use 'bool' for BLI_/BKE_ functions. 2013-03-09 05:35:49 +00:00
091d86b9cb style cleanup: 'sizeof foo' --> 'sizeof(foo)', add check in style checking script. 2013-02-21 17:18:27 +00:00
436bbdfd24 style cleanup: use more const's in BLI_heap & dpx/cineon style cleanup 2012-10-22 13:00:02 +00:00
ddc2dbc2a4 style cleanup 2012-10-22 08:15:51 +00:00
30fd258a0b fix for own error in BLI_heap_new_ex() when zero size is passed. 2012-10-22 07:57:21 +00:00
a4b2783169 small optimization for BLI_heap(), give some speedup in decimeter.
- use unsigned ints only (where mixing signed/unsigned)
- turn heap_swap into an inline function, add SWAP_TVAL macro to swap values using a temp value as storage.
- added type checking SHIFT3/4 macros

also style cleanup for CTR_Map
2012-10-22 03:25:53 +00:00