aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/utils/method_index.h
blob: 04944049c2958c0fec8d4b3f1e03f69544d7f9a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once

#include <util/system/platform.h>
#include <cstring>
#include <cstdint>

namespace NYql {

size_t GetMethodPtrIndex(uintptr_t ptr);

template<typename Method>
inline size_t GetMethodIndex(Method method) {
    uintptr_t ptr;
    std::memcpy(&ptr, &method, sizeof(uintptr_t));
    return GetMethodPtrIndex(ptr);
}

}