This commit is contained in:
wangjiyu 2025-04-10 21:41:20 +08:00
parent 30c05fd514
commit b1d5d59597
1 changed files with 3 additions and 0 deletions

View File

@ -91,6 +91,9 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
void* func_ptr = numpyApi_[93]; void* func_ptr = numpyApi_[93];
std::cout << "Raw function pointer: " << func_ptr << std::endl; std::cout << "Raw function pointer: " << func_ptr << std::endl;
auto ptmp = (PyObject*(*)(int, npy_intp*, int))numpyApi_[93];
std::cout << "ptmp is:" << ptmp << std::endl;
// 2. 使用memcpy避免编译器优化问题 // 2. 使用memcpy避免编译器优化问题
PyArray_SimpleNew_t PyArray_SimpleNew; PyArray_SimpleNew_t PyArray_SimpleNew;
static_assert(sizeof(func_ptr) == sizeof(PyArray_SimpleNew), static_assert(sizeof(func_ptr) == sizeof(PyArray_SimpleNew),