-->
Page 1 of 2

Dynamic memory (solved)

PostPosted: Fri Feb 06, 2015 8:38 pm
by Dani
Hello, my name is Daniel and I'm new here. I started programming the ESP8266 with the SDK a few weeks ago and now I'm at the point where I need dynamic memory. I found out, that there are four functions to manage dynamic memory:
os_malloc
os_realloc
os_zalloc
os_free

malloc, realloc and free are clear, but what is zalloc for?

Thanks and best regards,
Dani :-)

Re: Dynamic memory

PostPosted: Sat Feb 07, 2015 2:47 am
by jcmvbkbc
Dani wrote:malloc, realloc and free are clear, but what is zalloc for?

zalloc == malloc + zeroize allocated memory.

Re: Dynamic memory

PostPosted: Sat Feb 07, 2015 4:10 am
by Dani
So it's thea same as calloc?

Thanks

Re: Dynamic memory

PostPosted: Sat Feb 07, 2015 4:14 am
by jcmvbkbc
Dani wrote:So it's the same as calloc?

It does similar thing, but it has different signature: void *os_zalloc(size_t).