All Projects → yuanzhubi → Call_in_stack

yuanzhubi / Call_in_stack

Licence: mit
Call a function in a new stack that allocated anywhere. Do not be afraid of stack limit in your coroutines! Try to make your stack shareable between all coroutines!

Projects that are alternatives of or similar to Call in stack

Fountain
Android Kotlin paged endpoints made easy
Stars: ✭ 175 (-11.17%)
Mutual labels:  coroutines
Piladb
Lightweight RESTful database engine based on stack data structures
Stars: ✭ 184 (-6.6%)
Mutual labels:  stack
C Macro Collections
Easy to use, header only, macro generated, generic and type-safe Data Structures in C
Stars: ✭ 192 (-2.54%)
Mutual labels:  stack
The Movie Db Kotlin
The Movie DB app using Kotlin with updated Android features
Stars: ✭ 176 (-10.66%)
Mutual labels:  coroutines
Stackoverflow Clone
Clone project of a famous Q/A website for developers which is stackoverflow built using MySQL-Express-React-Node 🌐
Stars: ✭ 182 (-7.61%)
Mutual labels:  stack
Interview Questions
List of all the Interview questions practiced from online resources and books
Stars: ✭ 187 (-5.08%)
Mutual labels:  stack
Finances
Simple finance control app as technology playground
Stars: ✭ 170 (-13.71%)
Mutual labels:  coroutines
Tsf
coroutine and Swoole based php server framework in tencent
Stars: ✭ 2,204 (+1018.78%)
Mutual labels:  coroutines
Mvvmtemplate
An Android Template with MVVM and Clean Architecture
Stars: ✭ 182 (-7.61%)
Mutual labels:  coroutines
Eazypermissions
Android library to handle runtime permission through Kotlin coroutines and Livedata.
Stars: ✭ 192 (-2.54%)
Mutual labels:  coroutines
Scrcast
Drop-in Android Screen Recording Library
Stars: ✭ 178 (-9.64%)
Mutual labels:  coroutines
Tooling
🧰 Up-to-date list of JavaScript and TypeScript tooling resources
Stars: ✭ 181 (-8.12%)
Mutual labels:  stack
Swoft Im
基于swoft-cloud的微服务架构,最小化拆分粒度,PHP7、多进程、协程、异步任务、mysql连接池、redi连接池、rpc连接池、服务治理、服务注册与发现、Aop切面、全注解
Stars: ✭ 189 (-4.06%)
Mutual labels:  coroutines
Docker Elastic Stack
ELK Stack Dockerfile
Stars: ✭ 175 (-11.17%)
Mutual labels:  stack
Grpc Kotlin
gRPC with Kotlin Coroutines
Stars: ✭ 190 (-3.55%)
Mutual labels:  coroutines
Android Clean Arch Coroutines Koin
Implemented by Clean Architecture, MVVM, Koin, Coroutines, Moshi, Mockk, LiveData & DataBinding
Stars: ✭ 173 (-12.18%)
Mutual labels:  coroutines
Android Kotlin Mvi Cleanarchitecture
Android + Kotlin + Modularization + Gradle Depedency managment + Gradle written in Kotlin DSL + Custom Gradle Plugin + MVVM + MVI + Clean Architecture + Repository Pattern + Coroutines + Flows + Koin + Retrofit2 + ROOM + Kotlin-Android-Extension + KtLints
Stars: ✭ 187 (-5.08%)
Mutual labels:  coroutines
Data Structures
A collection of powerful data structures
Stars: ✭ 2,534 (+1186.29%)
Mutual labels:  stack
Fooproxy
稳健高效的评分制-针对性- IP代理池 + API服务,可以自己插入采集器进行代理IP的爬取,针对你的爬虫的一个或多个目标网站分别生成有效的IP代理数据库,支持MongoDB 4.0 使用 Python3.7(Scored IP proxy pool ,customise proxy data crawler can be added anytime)
Stars: ✭ 195 (-1.02%)
Mutual labels:  coroutines
Anko Core
基于Kotlin+Anko+协程+Retrofit2的demo,完全采用anko DSL布局,也可以作为Android快速开发框架,大量常用工具类,扩展函数
Stars: ✭ 189 (-4.06%)
Mutual labels:  coroutines

Welcome to call in stack!

Call a function in a new stack that allocated anywhere. Do not be afraid of stack limit in your coroutines! Try to make your stack shareable between all coroutines!

Attention! It is not a coroutine library, but a library to help your stackful coroutine work more effeicently in memory cost.

#include "call_in_stack.h"
char buffer[4096];
call_in_stack(buffer, &printf, "Hello world!\n");
//Now printf run in buffer as its stack!

Goto https://github.com/yuanzhubi/call_in_stack/wiki/Welcome-to-call_in_stack for details.

Goto QQ Group :293767138(talk_in_stack) for further discussion.


Q:Why it is called "call_in_stack"?

A:It behaves like the impelment of linux system call(the kernel space codes must run in a new stack to avoid user codes know its temporate result saved in memeroy) but it supports more(either the count or the type) arguments and type safe. What's more, the X86 Linux kernel uses the name "call_on_stack" while the arm kernel uses "call_with_stack". So we choose "call_in_stack" ^_^!

Q:When it is used?

A:Using it, you can mannually control your stack allocation to avoid "stack over flow"(You can call_in_stack your function in heap!). It can be used for function calling that never leads to stackful coroutines switching then the function call do not cost stack of current coroutine. It is also useful for deep recursive calling like regular expressions analysis.

What's more, it can be used for designing a new stackless coroutine library by caller allocating new stack for callee(but the caller do not know the accurate stack need of the callee so the size is rough) in c++03, while in std::experimental::coroutine the callee allocating storage only for the arguments and local variables that will be used(resumed) after await or yield, with more accurate space cost but c++17 needed.


Version 1.0.6: Important adaptive improvement for lower version of GCC!

In this version:

We add support of using call_in_stack in x64 of old GCC version ( tested since GCC 3.4), compiled with no optimization option. (In previous version of call_in_stack, compiling with no optimization option in x64 of old GCC version will fail to complete compile.)


Version 1.0.5: Important adaptive improvement for higher version of GCC!

In this version:

We remove __builtin_unreachable in our library because GCC has different semantic in high version(since 4.5);

We disable the -fipa-sra optimize for "do_call" function (with no performance lost because it is an assemble function indeed) in our library because it breaks the system V ABI and arguments forwarding rule.


Version 1.0.2: Now we support call_in_stack for member function.

std::string a("Hello world"); call_in_stack(printf, "%s\n", call_in_stack(from_member_fun(a, c_str))) ;

And we support call_in_stack for functor or lambda in C++11!

std::string a("Hello world"); call_in_stack_safe(buf, from_functor( [=](int arg){ printf("%s\n", a.c_str()); return arg; } ),2) ;

That means you can write most of your codes of function in a new stack!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].