Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Thanks for promoting umm_malloc #1

Open
rhempel opened this issue Mar 3, 2015 · 6 comments
Open

Thanks for promoting umm_malloc #1

rhempel opened this issue Mar 3, 2015 · 6 comments

Comments

@rhempel
Copy link

rhempel commented Mar 3, 2015

I am the original author of umm_malloc, and for fun I did a search on where it was being used and came upon your site. Thanks for the kind words and support of the library, I have not really touched it in years but it's good to know it's helping someone.
I have now created a GitHub repo of my own for this project, and would like to pull your changes (and give you credit of course) if that's OK with you.
Also, I plan on changing the test suite so that it uses a more standard testing framework - these things were not as popular years ago :-)

@dimonomid
Copy link
Owner

Hello Ralph, nice to hear from you!

Yeah, since I found umm_malloc I use it in my every embedded project, it is really great. Thank you very much for your hard work on it.

That's great that you've created your own repo, so that allocator could be improved even more! And about testing - ironically enough, I'm myself learning testing framework (in particular, CppUTest) for my embedded designs these days. It looks promising, its author even wrote the book, in case you're interested: Test Driven Development for Embedded C

About pulling changes: of course I'm glad to hear that, please let me know if you're waiting for me to do something (I'm not sure how exactly changes could be pulled from my repo to yours, should I do something for that?)

@almania
Copy link

almania commented Mar 8, 2015

Hi both,

Firstly, neat allocator, was looking for an open source one aimed at embedded devices and this is just great.

Secondly.. there's a bug. In umm_realloc: on a malloc failure, it frees the original pointer. The standard assures this not to be the case, and Lua assumes this too (eg when reallocing hash tables, it assumes data isn't lost/corrupt should an expansion fail).

The fix is very straight forward - just move umm_free( oldptr) in umm_realloc to the same block as the memcpy.

The bug is present both here and on @rhempel's website.

HTH and thanks again for making it available here :)

@rhempel
Copy link
Author

rhempel commented Mar 8, 2015

Technically, this should be a new issue :-) Side note, are you using this allocator in an embedded Kua implementation - that's what I wrote it for in the first place! If I get a chance, I'll fix on my site...

@almania
Copy link

almania commented Mar 9, 2015

I figured it should be after I posted, I was just too eager when I saw you both in one place ;). My first time using github.

And I am, I saw that on your site too - one of the things that drew me to it. Lua 5.2, which includes an emergency garbage collector in case of OOM which allows the allocator to run closer to the limit (I believe most embedded are Lua 5.1.X?), probably why it hasn't popped up before. Working great now though :)

@rhempel
Copy link
Author

rhempel commented Mar 9, 2015

Well, I'm using it for Lua as well, on the LEGO MINDSTORMS NXT - and I was having an issue occasionally when the garbage collector had to run - maybe this is related - actually it's very likely related. Thks for the report. I am more focused on ev3dev.org (Debian Jessie on LEGO MINDSTROMS EV3) right now, but I will definitely look at this when I have time

@TheBigFish
Copy link

Hello everyone.
This library is exactly what I need.Thank you very much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants