Open user2222222222 opened 4 months ago
We have a compile time switch to add some safety padding around memory blocks already.
Do you have a use case for initializing the entire heap to some specific value?
Not one useful in any kind of new design, but something I needed for virtualizing an old system. Some old embedded devices initialize the heap with a checker pattern. Needed to keep it the same when wrapping it with umm and that was the easiest thing to do without changing anything else. What I did is working fine, but didn't investigate the changes I made: just did what looked logical.
Here is what I can do - there are a couple of options.
I am leaning to option 2 since we already have a nice mechanism for overriding values :-)
Option 2 is what works for me and considering the rarity of it's application, seems like the best thing to do. In the unlikely case someone needed a dynamic option, it would be an easy and thoughtless modification. And that's the only reason I brought it up at all: it would have been nice for it to be there so I didn't have to wonder whether I might be breaking some obscure special case (we've all been there before.)
It would be nice to be able to initialize the heap to something other than zero (such as a checker pattern: 0x55).
#define UMM_HEAPINIT 0x55
It looks like these are the only changes needed in umm_multi_init_heap(), but thought I'd bring it up here in case you think it's worth adding, but mainly to make sure I'm not missing something: