Writing my operating system I have come to such a point that I have to use malloc. Unfortunately, I don't know how to start writing memory allocator at all, so I decided to integrate another one with my OS. liballoc looked cool and was easy to use. However, I saw a thread on this forum in which it was written that it doesn't work properly with 64-bit systems. Other allocators listed in this article - https://wiki.osdev.org/Memory_Allocation are difficult to integrate.
Are there any other easy to use memory allocators not mentioned in this article? I don't need it to be cool, it can even be slow, unstable and use a lot of memory, my OS doesn't even have multitasking yet. I just want it to be simple and easy to use.
easy to use memory allocator for single-threaded 64-bit OS
Re: easy to use memory allocator for single-threaded 64-bit
Both simple slab and buddy allocators are fairly easy to implement. Here's one link to a slab allocator implementation: http://3zanders.co.uk/2018/02/24/the-slab-allocator/
With a little Googling you can find other implementations and simple buddy allocators. This is a lot easier than it first appears to be. I'd recommend that you experiment with a simple application in Linux (or whatever your development platform is) allocating memory from a fixed array of bytes; you can then easily integrate it into your OS. That way you'll be able to run it in a debugging environment to ensure that it works correctly (and that you understand how it works).
With a little Googling you can find other implementations and simple buddy allocators. This is a lot easier than it first appears to be. I'd recommend that you experiment with a simple application in Linux (or whatever your development platform is) allocating memory from a fixed array of bytes; you can then easily integrate it into your OS. That way you'll be able to run it in a debugging environment to ensure that it works correctly (and that you understand how it works).