I would dissuade you from trying the regions. The problem is that to ensure the security of the regions you need a very complex type system. I am sure that you looked at the documents of Tofte and Talpin, and you have an idea of the difficulties associated with this. Even if you succeed in the regions, the likelihood that your program will require life, the life of which the program is, is that this region, at least, should be collected from garbage. (This is why Cyclone has areas and GC.)
Since you are just starting out, I would advise you to go with garbage collection. Modern garbage collectors can be made pretty quickly without much effort. The main problem is to allocate from adjacent free space so that the distribution is fast. This helps to target AMD64 or another machine with spare registers so that you can use the hardware register as a pointer to the location.
There are many good ideas for adaptation; One of the easiest to implement is a page-based collector, such as Joel Bartlett's copy picker, where the idea is that you only select from completely blank pages.
If you want to learn about existing garbage collectors, Lua has a rather complicated incremental garbage collector (so there are no visible pause times) and the implementation is only 700 lines. It is fast enough to be used in many games where performance is important.
source share