Results 15 comments of Yi Wang

Problem solved after several steps. But I forget the details. Kind of things like what you say. @Unayung

遇到同样的问题,coroutine_resume(S,co1) 调用 getcontext 这个函数时会修改 co2 里的内容,我猜测 macOS 里定义了不同的 ucontext_t,占用的内存更大,转换的过程中访问越界了。

ok. 搞懂了。 首先,应该引入 #include ,而不是 。因为使用到的函数并没有被声明在 里。因为某些原因编译通过了,但是类型估计是不同的。编译时加 flag 跳过检查:-D_XOPEN_SOURCE=600 其次,swapcontext 在 macOS 系统中的实现依赖于在栈上的返回地址,在调用 swapcontext 之前保存栈的信息会导致死循环。 苹果的实现见: https://github.com/Apple-FOSS-Mirror/Libc/blob/2ca2ae74647714acfc18674c3114b1a5d3325d7d/i386/gen/swapcontext.c 这里是我修改后可以跑通的代码(在同一个函数里保存和 swap 就行了): https://gist.github.com/Jeswang/4ae2b612f0c2da20265d1d6407b6cd2b

I actually developed on 10.10 and didn't see this problem here. Do you know how to run the application in Terminal? May print some helpful information.

![image](https://cloud.githubusercontent.com/assets/553783/8270256/c07e18d2-1809-11e5-80fb-e7a8a998b44a.png)

OK, I have seem the problem on my another laptop. Will fix up quickly.

It seems it will be white when first opening, and everything is OK after you close it up and reopen.

It seems there is no direct solution to show a window in another app's full screen. I will search later, thank you for suggestion.