SomeGuyWithAKeyboard wrote:Would be nice if there was a c++ dynamic array that that uses no outside libraries so I could substitute that in and see if my vector equivalent class is broken or not but there isn't one.
I'm sure it's not trivial, but you can always try ripping the std::vector implementation out of libstdc++. That should only rely on other libstdc++ pieces and a working malloc.
SomeGuyWithAKeyboard wrote:It should also be noted that in my system, I need to be able to manually define where in memory allocated memory should be stored.
That's usually how it works in an OS kernel.
SomeGuyWithAKeyboard wrote:I think liballoc_alloc is intended to be used for this but I still haven't figured out how it is meant to be used.
It's meant to hook into your page allocator. In a typical OS using paging, that would be a call to the virtual memory manager to find an appropriate range of virtual addresses and populate them with pages allocated via the physical memory manager.
SomeGuyWithAKeyboard wrote:The best hack I could come up with was making liballoc_alloc always return (void*)0x20000 since it only ever seems to call liballoc_alloc if there are no tags or pages already in memory and it allocates the next block based on where the previous one is.
It needs to return free memory (or NULL) every time it's called. I don't think liballoc will behave very well if you give it the same address twice.