Blender V4.3
memory_utils.c
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
12#include <string.h>
13
14#include "BLI_sys_types.h"
15#include "BLI_utildefines.h"
16
17#include "BLI_memory_utils.h"
18
19#include "BLI_strict_flags.h" /* Keep last. */
20
21bool BLI_memory_is_zero(const void *arr, const size_t arr_size)
22{
23 const char *arr_byte = arr;
24 const char *arr_end = (const char *)arr + arr_size;
25
26 while ((arr_byte != arr_end) && (*arr_byte == 0)) {
27 arr_byte++;
28 }
29
30 return (arr_byte == arr_end);
31}
Generic memory manipulation API.
bool BLI_memory_is_zero(const void *arr, const size_t arr_size)