English 中文(简体)
通行证 两个金字模块之间的C功能点
原标题:Passing C function pointers between two python modules

I m 撰写一份与花.相关的申请。 两种类型的gin: Engine <>/code>和Model

由于执行原因,这些方法可在C部分印成allowed>>。 这意味着有时会写在Adhurk,有时在C中写。

问题是,这些部队在<代码>Engine.update(>(并重新确认GIL)上用了一条昂贵的波纹功能。 我想到的是,在APIC中添加诸如Model.get_spe_c_func()等内容,以便Model的实施工作能够在C版 快速(方法>上添加一个点,使Engine能够更快地使用C功能。

我应利用哪类数据来通过职能点? 而这种良好设计究竟是什么,也许会比较容易?

最佳回答

为此目的,有二氧化碳(PyCOBject)数据类型。 它拥有一个空白,但可以储存你希望的任何数据。 你确实必须小心,不要把错误的二氧化碳放在错误的职能之下,因为其他图书馆的科目将像你自己的那样看待。

如果你想要更多的类型的安全,你可以很容易地将自己的PyType用于这一目的;毕竟,你必须做的是右哪一个点。

问题回答

暂无回答




相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...

热门标签