<commit_before>/* Copyright 2012 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef REV_H_
#define REV_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>

#define MEMREV_VECTOR_SIZE 16

/**
 * Reverses the order of a block of memory.
 *
 * The memory block is treated as an array of length @a count containing ints
 * of size @size.
 *<commit_msg>Add a note about performance.<commit_after>/* Copyright 2012 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef REV_H_
#define REV_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>

#define MEMREV_VECTOR_SIZE 16

/**
 * Reverses the order of a block of memory.
 *
 * The memory block is treated as an array of length @a count containing ints
 * of size @size.
 *
 * Performance note: When vector acceleration is enabled, this function can
 * achieve much higher performance when the input bounds are aligned to the
 * vector register width (exposed as the preprocessor macro
 * MEMREV_VECTOR_SIZE). Specifically, the highest performance is achieved when
 *  - @a data is aligned to MEMREV_VECTOR_SIZE, and
 *  - @a count is a multiple of 2 * MEMREV_VECTOR_SIZE
 *
{'fraction_non_alphanumeric': 0.07217907720420283, 'fraction_numerical': 0.009593421653723162, 'mean_word_length': 3.8775055679287305, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3277914', 'n_tokens_mistral': 630, 'n_tokens_neox': 609, 'n_words': 299}