Skip to content

Commit 8ac2d67

Browse files
committed
Make bytes_to_python const non-static
1 parent d4202cd commit 8ac2d67

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/core/bpf_map.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "core/bpf_map.h"
22
#include "core/bpf_exception.h"
33
#include "core/bpf_object.h"
4+
#include "utils/struct_parser.h"
45
#include <algorithm>
56
#include <cerrno>
67
#include <cstring>
@@ -233,7 +234,7 @@ void BpfMap::python_to_bytes_inplace(const py::object &obj,
233234
}
234235
}
235236

236-
py::object BpfMap::bytes_to_python(std::span<const uint8_t> data) {
237+
py::object BpfMap::bytes_to_python(std::span<const uint8_t> data) const {
237238
// NOTE: Struct parsing for value type
238239
if (struct_parser_ && !value_struct_name_.empty()) {
239240
py::bytes py_data(reinterpret_cast<const char *>(data.data()), data.size());

src/core/bpf_map.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class BpfMap : public std::enable_shared_from_this<BpfMap> {
7979
private:
8080
static void python_to_bytes_inplace(const py::object &obj,
8181
std::span<uint8_t> buffer);
82-
static py::object bytes_to_python(std::span<const uint8_t> data);
82+
py::object bytes_to_python(std::span<const uint8_t> data) const;
8383
};
8484

8585
#endif // PYLIBBPF_BPF_MAP_H

0 commit comments

Comments
 (0)