The problem seemed to stem for (at least in the test code) from using an absolute mess of defines and where they were defined. With everything laid out "properly?" like a library should be defines in headers I was able to see that memory init was trying to use negative memory size. I'm not sure why there isn't a guard against this in umm_malloc itself and I can see there was an issue opened for this I will just add my own.Excellent news. Any insights into why it wasn't ?A little more clean up and some checks added and I think it's working correctly
The only other tip I can offer is, when printing labelled memory addresses, print them in what is expected to be ascending address order. That way it's easier to understand what your labelling means and verify they have sensible and logically correct addresses. Any out-of-order address will stand out like a sore thumb if something does need investigating and fixing.
For example your earlier list -I suspect 'Stack One Bottom' and 'Stack One Top' are correct, but having the same value would cause me to ask if it were, if you asked if anyone could see anything odd or possibly wrong with what you had.Code:
__bss_end__ : 20001D80__end__ : 20001D80Heap_size : 240256Heap top : 2003C800Heap limit : 20040000Stack limit : 20040000Stack Bottom : 20040800Stack Top : 20041000Stack One Bottom : 20042000Stack One Top : 20042000
Having the memory print out in logical order makes a lot of sense the problem was at the time I didn't know what that order should be and if you flip the stacks the order is different.
The only thing I don't like and I'm not sure how to CMake the solution
The main CMake needs this line added set (SKIP_PICO_MALLOC 1) and the includes for my memory manager need to be #include <{path_to_umm_malloc}/memmng.h> I want to fix both from the library CMake so all I need to do is include the folder and add it as a library.
That last bit is done CMakeLists.txt works without extra work. Now all I need to do is drop it into a project and it will automatically configure itself I don't know if I should but I made it also create it's configuration file.
Statistics: Posted by DarkElvenAngel — Sat Dec 21, 2024 8:16 pm