Commit graph

11 commits

Author SHA1 Message Date
Xury Greer
cfc11e52bb Cleanup: Spelling in intern/cycles directory
Fixes the following misspellings:

"equi-angular" -> "equiangular"
"otheriwse" -> "otherwise"
"implememted" -> "implemented"
"tranmissitance" -> "transmittance"
"derivates" -> "derivatives"
"cauzed" -> "caused"
"unsinged" -> "unsigned"
"stochastical" -> "stochastic"
"LighTree" -> "LightTree"
"stdilb" -> "stdlib"
"colospace" -> "colorspace"
"evaulated" -> "evaluated"

Pull Request: https://projects.blender.org/blender/blender/pulls/163850
2026-09-14 12:09:40 +02:00
Brecht Van Lommel
b26e16e151 Refactor: Unify memory API to MEM_new and MEM_delete variations
This change removes the need to to carefully pair MEM_mallocN/MEM_new_for_free
with MEM_freeN and MEM_new with MEM_delete. Instead all function are now
variations of MEM_new and MEM_delete.

* MEM_new_for_free -> MEM_new
* MEM_mallocN -> MEM_new_uninitialized
* MEM_callocN -> MEM_new_zeroed
* MEM_freeN -> MEM_delete (for typed pointers)
* MEM_freeN -> MEM_delete_void (for void pointers)
* MEM_reallocN -> MEM_realloc_uninitialized
* MEM_recallocN -> MEM_realloc_zeroed
* MEM_dupallocN -> MEM_new (when possible)
* MEM_dupallocN -> MEM_dupalloc (for typed pointers)
* MEM_dupallocN -> MEM_dupalloc_void (for void pointers)

The MEM_malloc and MEM_calloc functions were renamed to make it clear that
they should be paired with MEM_delete and to clarify what they do.

The compiler will emit an error if MEM_delete or MEM_delete_void is used on
the wrong pointer type. However a remaining risk is casting a MEM_new allocation
with a non-trivial destructor to a void pointer (which is the same as before). This is
why MEM_delete_void and MEM_dupalloc_void exist as a separate functions,
to identify legacy code that has this risk and should be eliminated over time.

Note that MEM_new_array only supports trivially destructible types. This
avoids the need for an equivalent of the delete [] operator and the associated
mistakes that can be made. Instead MEM_delete can be used for everything. For
non-trivial types, data structures like Vector should be used instead.

MEM_dupalloc is now also more type safe. As before it is only supported on
trivially copyable types, and this is now enforced through static asserts to
prevent mistakes. It is also templated to remove the need for casts.

Pull Request: https://projects.blender.org/blender/blender/pulls/151387
2026-01-26 19:20:33 +01:00
Brecht Van Lommel
0e8a7c751a Refactor: Cycles: Simplify util_guarded_mem_alloc/free calls
Pull Request: https://projects.blender.org/blender/blender/pulls/132912
2025-01-29 14:11:47 +01:00
Brecht Van Lommel
57ff24cb99 Refactor: Cycles: Add const keyword to more function parameters
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:23:24 +01:00
Brecht Van Lommel
d0c2e68e5f Refactor: Cycles: Automated clang-tidy fixups in Cycles
* Use .empty() and .data()
* Use nullptr instead of 0
* No else after return
* Simple class member initialization
* Add override for virtual methods
* Include C++ instead of C headers
* Remove some unused includes
* Use default constructors
* Always use braces
* Consistent names in definition and declaration
* Change typedef to using

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:55 +01:00
Brecht Van Lommel
3c2a6fbb9c Refactor: Cycles: Use nullptr instead of NULL
Pull Request: https://projects.blender.org/blender/blender/pulls/132361
2025-01-03 10:22:43 +01:00
Campbell Barton
fdd0b93cfa Cleanup: spelling in comments 2024-08-23 10:19:53 +10:00
Campbell Barton
c12994612b License headers: use SPDX-FileCopyrightText in intern/cycles 2023-06-14 16:53:23 +10:00
Brad Smith
322dab936f Build: fixes for OpenBSD
Pull Request: https://projects.blender.org/blender/blender/pulls/107666
2023-05-09 13:19:16 +02:00
Brecht Van Lommel
9cfc7967dd Cycles: use SPDX license headers
* Replace license text in headers with SPDX identifiers.
* Remove specific license info from outdated readme.txt, instead leave details
  to the source files.
* Add list of SPDX license identifiers used, and corresponding license texts.
* Update copyright dates while we're at it.

Ref D14069, T95597
2022-02-11 17:47:34 +01:00
Brecht Van Lommel
fd25e883e2 Cycles: remove prefix from source code file names
Remove prefix of filenames that is the same as the folder name. This used
to help when #includes were using individual files, but now they are always
relative to the cycles root directory and so the prefixes are redundant.

For patches and branches, git merge and rebase should be able to detect the
renames and move over code to the right file.
2021-10-26 15:37:04 +02:00
Renamed from intern/cycles/util/util_aligned_malloc.cpp (Browse further)