Blender  V3.3
memory_utils.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
10 #include <string.h>
11 
12 #include "BLI_sys_types.h"
13 #include "BLI_utildefines.h"
14 
15 #include "BLI_memory_utils.h"
16 
17 #include "BLI_strict_flags.h"
18 
19 bool BLI_memory_is_zero(const void *arr, const size_t arr_size)
20 {
21  const char *arr_byte = arr;
22  const char *arr_end = (const char *)arr + arr_size;
23 
24  while ((arr_byte != arr_end) && (*arr_byte == 0)) {
25  arr_byte++;
26  }
27 
28  return (arr_byte == arr_end);
29 }
Generic memory manipulation API.
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
bool BLI_memory_is_zero(const void *arr, const size_t arr_size)
Definition: memory_utils.c:19