aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/data/writable_memory.h
blob: 81c70eba7e70a4a828dfe4164d50d0a959fb9c3c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <cstddef>

namespace vespalib {

/**
 * Simple wrapper referencing a writable region of memory. This class
 * does not have ownership of the referenced memory region.
 **/
struct WritableMemory {
    char   *data;
    size_t  size;
    WritableMemory() : data(nullptr), size(0) {}
    WritableMemory(char *d, size_t s) : data(d), size(s) {}
};

} // namespace vespalib