Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow force noinline #21

Open
ice1000 opened this issue Sep 6, 2017 · 10 comments
Open

Allow force noinline #21

ice1000 opened this issue Sep 6, 2017 · 10 comments
Assignees

Comments

@ice1000
Copy link
Contributor

ice1000 commented Sep 6, 2017

应该搞那种,全inline模式和强制某个方法或者lambda不被inline。

@Seng-Jik
Copy link
Contributor

Seng-Jik commented Sep 7, 2017

这个在语义上有影响吗

@ice1000
Copy link
Contributor Author

ice1000 commented Sep 7, 2017

如果inline所有高阶函数就不需要处理变量捕获了,性能.inc()(心理作用

@ice1000
Copy link
Contributor Author

ice1000 commented Sep 7, 2017

应该还是有吧,对C++来说一个lambda就是一个类和它的单例对象啊,然后实际上发生了很多编译期隐式转换的

@AkimotoAkari
Copy link
Collaborator

(然而你不知道有顶层作用域的吗,反正捕获是少不了的了

@ice1000
Copy link
Contributor Author

ice1000 commented Sep 10, 2017

但如果所有本身带捕获的lambda都被inline就不需要实现捕获了,顶层作用域不可能的,要是捕获了移到顶层估计会非常混乱,到时候全局变量多到包你哈希碰撞

@AkimotoAkari
Copy link
Collaborator

(- -你不是忘记了变量命名的法则了吧- -加后缀什么的- 怎么说2^31很少见吧

@ice1000
Copy link
Contributor Author

ice1000 commented Sep 10, 2017

我加的是哈希。另外我担心的是多个程序链接的时候冲突

@ice1000
Copy link
Contributor Author

ice1000 commented Sep 10, 2017

变量重命名肯定得做啊 我又不是傻

@ice1000
Copy link
Contributor Author

ice1000 commented Sep 10, 2017

而且捕获移动到顶层作用域的话,就可以造成潜在的野指针(delete了之后那玩意依然可以被拿出来

@ice1000
Copy link
Contributor Author

ice1000 commented Sep 10, 2017

目前暂时没有需要要做这一步,先临时靠全部inline解决,后面再说捕获的事(不过C++/全部JVM-lang/C#等语言都是靠的生成类来实现lambda的,我比较想照抄,虽然还是很难做

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants