Closed seekaddo closed 6 years ago
Regarding malloc
: It's actually implemented in libmemory. Malloc implementations are very situation-dependent and can vary widely depending on whether you're using a PC, bare metal firmware, or an RTOS. I have kept malloc
separate to account for that fact. I think the documentation for malloc
should still be included here because it is technically a libc function.
I will eventually make it a submodule, but I have not yet architected a good way to include it in the build system. I'll be thinking more about that in the coming weeks.
Regarding errno
: Leaving the notes in is fine, as I do plan on adding support (#6)
Thanks again for your great help!
@phillipjohnston oh ok. Then everything will be great. Thanks for the explanation. Yea with the errno I was thinking about how to implement it to support both sterrorr() and others. I was thinking of using enum for defining all the type errno's EINVAL
... etc. and a static string array
enum {EINVAL,....} errn;
extern errn errno;
static const char *const MALLOC = {"Each malloc interpretation in strings"}
Something like this I have in mind.
Doxygen documentation for the functions in string.h. I have already tested it.
errno and malloc.
The strdup function makes a call to malloc in its implementation. I was wondering which malloc is that then since can't use the normal libc malloc for Embedded. Can we implement a simple wrapper malloc for this? With just a simple ringbuffer to a static array.
All kinds of Feedback and suggestions are welcome.