<commit_before>/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * 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 INCLUDE_PERFETTO_TRACING_CORE_CHUNK_H_
#define INCLUDE_PERFETTO_TRACING_CORE_CHUNK_H_

#include <stddef.h>

#include <memory>
#include <vector>

namespace perfetto {

// A simple wrapper around a virtually contiguous memory range that contains a
// TracePacket, or just a portion of it.
struct Chunk {
  Chunk() : start(nullptr), size(0) {}
  Chunk(const void* st, size_t sz) : start(st), size(sz) {}
  Chunk(Chunk&& other) noexcept = default;

  // Create a Chunk which contains (and owns) a copy of the given memory.
  static Chunk Copy(const void* start, size_t size) {
    Chunk c;<commit_msg>perfetto: Fix gcc build am: 71c29e9cdb am: 8769347ed2 am: d01e65b2a0<commit_after>/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * 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 INCLUDE_PERFETTO_TRACING_CORE_CHUNK_H_
#define INCLUDE_PERFETTO_TRACING_CORE_CHUNK_H_

#include <stddef.h>
#include <string.h>

#include <memory>
#include <vector>

namespace perfetto {

// A simple wrapper around a virtually contiguous memory range that contains a
// TracePacket, or just a portion of it.
struct Chunk {
  Chunk() : start(nullptr), size(0) {}
  Chunk(const void* st, size_t sz) : start(st), size(sz) {}
  Chunk(Chunk&& other) noexcept = default;

  // Create a Chunk which contains (and owns) a copy of the given memory.
  static Chunk Copy(const void* start, size_t size) {
    Chunk c;
{'fraction_non_alphanumeric': 0.0852561595619867, 'fraction_numerical': 0.014470082127493155, 'mean_word_length': 4.146881287726358, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '4136297', 'n_tokens_mistral': 787, 'n_tokens_neox': 749, 'n_words': 322}