新增功能
#include "co/benchmark.h"
#include "co/mem.h"
BM_group(malloc) {
void* p;
BM_add(::malloc)(
p = ::malloc(32);
);
BM_use(p);
BM_add(co::alloc)(
p = co::alloc(32);
);
BM_use(p);
}
int main(int argc, char** argv) {
flag::parse(argc, argv);
bm::run_benchmarks();
return 0;
}
功能增强
- 协程调度优化。
- 协程相关组件增强,
co::mutex
, co::event
, co::chan
等可以在协程或非协程中使用,co::chan
中可以存储 std::string
等非 POD 类型。
其他
- 移除
Random
类,提供 co::rand()
,co::randstr()
方法,头文件重命名为 co/rand.h
。
- 移除全局的
Thread
、Mutex
类。
co::*scheduler*
等 API 重命名为 co::*sched*
。
- 其他改进、bug修复等。