2 * Copyright (c) Meta Platforms, Inc. and affiliates.
5 * This source code is licensed under both the BSD-style license (found in the
6 * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7 * in the COPYING file in the root directory of this source tree).
8 * You may select, at your option, one of the above-listed licenses.
10 #include "fuzz_helpers.h"
16 void* FUZZ_malloc(size_t size)
19 void* const mem = malloc(size);
26 void* FUZZ_malloc_rand(size_t size, FUZZ_dataProducer_t *producer)
29 void* const mem = malloc(size);
34 /* Add +- 1M 50% of the time */
35 if (FUZZ_dataProducer_uint32Range(producer, 0, 1))
36 FUZZ_dataProducer_int32Range(producer, -1000000, 1000000);
42 int FUZZ_memcmp(void const* lhs, void const* rhs, size_t size)
47 return memcmp(lhs, rhs, size);