Files
goo-engine/source/blender/blenlib/intern/memory_utils.c
T
Campbell Barton 3f8cd44485 Cleanup: move BLI_strict_flags.h last, not that it should be kept last
Also add a note in the header why it should be kept last.
2024-02-14 13:40:31 +11:00

32 lines
668 B
C

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup bli
* \brief Generic memory manipulation API.
*
* This is to extend on existing functions
* such as `memcpy` & `memcmp`.
*/
#include <string.h>
#include "BLI_sys_types.h"
#include "BLI_utildefines.h"
#include "BLI_memory_utils.h"
#include "BLI_strict_flags.h" /* Keep last. */
bool BLI_memory_is_zero(const void *arr, const size_t arr_size)
{
const char *arr_byte = arr;
const char *arr_end = (const char *)arr + arr_size;
while ((arr_byte != arr_end) && (*arr_byte == 0)) {
arr_byte++;
}
return (arr_byte == arr_end);
}