TarsCloud / TarsCpp

C++ language framework rpc source code implementation
BSD 3-Clause "New" or "Revised" License
517 stars 254 forks source link

修改xxx_fcontext名称 #294

Closed JanuarYJL closed 7 months ago

JanuarYJL commented 8 months ago

在使用时与其他库(比如libgo)一起链接,会遇到多个库引用不同版本boost fcontext的问题产生冲突导致程序崩溃,修改xxx_fcontext名称,避免与其他使用boost fcontext的库产生冲突

ruanshudong commented 8 months ago

名字空间还区分不了么? 这个不建议修改, 修改以后, 同步这部分代码太难维护了.

JanuarYJL commented 8 months ago

这个还是会同步boost的fcontext版本是吧?那我再看下是否有别的办法

JanuarYJL commented 8 months ago

namespace确实无法区分,查了一下其他协程库, 比如阿里的async_simple https://github.com/alibaba/async_simple/blob/main/async_simple/uthread/internal/Linux/x86_64/jump_x86_64_sysv_elf_gas.S 也是使用了boost的 fcontext,自行修改了xxx_fcontext的名称 是否可以考虑增加一个维护脚本 因为其实只需要执行一下sed即可: find ./TarsCpp/util/src/asm -type f -exec sed -i 's/make_fcontext/tars_make_fcontext/g' {} + find ./TarsCpp/util/src/asm -type f -exec sed -i 's/jump_fcontext/tars_jump_fcontext/g' {} + find ./TarsCpp/util/src/asm -type f -exec sed -i 's/ontop_fcontext/tars_ontop_fcontext/g' {} +