Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_array.h
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | void _bli_array_grow_func(void **arr_p, | ||||
| const int arr_len, | const int arr_len, | ||||
| const int num, | const int num, | ||||
| const char *alloc_str); | const char *alloc_str); | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Public defines | /** \name Public defines | ||||
| * \{ */ | * \{ */ | ||||
| /** use ``sizeof(*(arr))`` to ensure the array exists and is an array */ | /** use `sizeof(*(arr))` to ensure the array exists and is an array */ | ||||
| #define BLI_array_declare(arr) \ | #define BLI_array_declare(arr) \ | ||||
| int _##arr##_len = ((void)(sizeof(*(arr))), 0); \ | int _##arr##_len = ((void)(sizeof(*(arr))), 0); \ | ||||
| void *_##arr##_static = NULL | void *_##arr##_static = NULL | ||||
| /** | /** | ||||
| * this will use stack space, up to maxstatic array elements, before | * this will use stack space, up to maxstatic array elements, before | ||||
| * switching to dynamic heap allocation */ | * switching to dynamic heap allocation */ | ||||
| #define BLI_array_staticdeclare(arr, maxstatic) \ | #define BLI_array_staticdeclare(arr, maxstatic) \ | ||||
| ▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines | |||||