Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/src/bpf_map/userspace/map_in_maps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class array_map_of_maps_impl : public array_map_impl {
{
auto key_val = array_map_impl::elem_lookup(key);
int map_id = *(int *)key_val;
return (void *)((u_int64_t)map_id << 32);
return (void *)((u_int64_t)map_id);
}
};

Expand Down
4 changes: 2 additions & 2 deletions runtime/src/bpftime_shm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,13 +581,13 @@ extern "C" uint64_t map_ptr_by_fd(uint32_t fd)
return INVALID_MAP_PTR;
}
// Use a convenient way to represent a pointer
return ((uint64_t)fd << 32) | 0xffffffff;
return fd;
}

extern "C" uint64_t map_val(uint64_t map_ptr)
{
SPDLOG_DEBUG("Call map_val with map_ptr={:x}", map_ptr);
int fd = (int)(map_ptr >> 32);
int fd = (int)map_ptr;
if (!shm_holder.global_shared_memory.get_manager() ||
!shm_holder.global_shared_memory.is_map_fd(fd)) {
SPDLOG_ERROR("Expected fd {} to be a map fd (map_val call)",
Expand Down
Loading