Skip to content

C library for deterministic memory de-allocation using (ddbb alike commit/rollback) transactions

Notifications You must be signed in to change notification settings

earizon/libctrans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libctrans consists in a set of macros arount setjump/longjmp to allow C code to be orginized in transactions in a way similar to that used in database programming.

When the transaction is "commited" (ended) or rolled back (exception raised) allocated resources are liberated.

Under the hood, a Transaction pointer must be passed to each function and wrapper functions ared used instead of standard ones. For example try_malloc transform into ctrans_try_malloc. Nevertheless, normal C can be mixed if used with care and is NOT discouraged. Basically it means that any C code inside a transaction that makes not use of ctrans frees any used resource before the transaction ends (either normally or through an exception).

libctrans promote code cleaner and safer since it tags logical transaction starts/stops and avoids repetitive error checking.

About

C library for deterministic memory de-allocation using (ddbb alike commit/rollback) transactions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published