troydhanson / uthash

C macros for hash tables and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[UTSTRING] Change the standard malloc()/free()

silvioprog opened this issue · comments

Hello.

The uthash feature allows to change the standard functions malloc(), free() etc. by replacing the macros uthash_malloc, uthash_free and so on. What do you thing about to adopt the same idea in other features like utstring? If you are OK, I could send a patch to implement it on utstring and utlist.

cheers

I'd be amenable to the idea. I don't personally use utstring or utlist, and my impression is that they don't have as many users as uthash, which I guess means that the voices of actual users should carry a lot of weight.

Do you use utstring and utlist, and suffer from the absence of this feature? Have you implemented it in a branch and proven to your satisfaction that it solves a problem you're having?

I'd be amenable to the idea.

😃

... I don't personally use utstring or utlist, and my impression is that they don't have as many users as uthash, which I guess means that the voices of actual users should carry a lot of weight.

Maybe some users don't say they use them, but the utstring/utlist are awesome features. I've used them in a library I'm maintaining and using in production around two years, and my conclusion is you did an incredible job in these headers. (thank you very much!)

Do you use utstring and utlist, and suffer from the absence of this feature? Have you implemented it in a branch and proven to your satisfaction that it solves a problem you're having?

Yes. The reason about suggesting the feature is to make utstring/utlist so customizable as uthash and the most important thing: portability.

Recently I added a tiny "memory manager" (allocator) to the library and mapped the macros uthash_malloc()/uthash_free(), I'm going to map the allocator of other libraries I'm using (zlib, pcre2, mhd, utstring/utlist etc.), so I would be glad to contribute by helping to implement this feature in utstring/utlist. I'm ready to make a fork and send it as PR. 😅