MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_calloc

Function rt_calloc

src/kservice.c:912–924  ·  view source on GitHub ↗

* @brief This function will contiguously allocate enough space for count objects * that are size bytes of memory each and returns a pointer to the allocated * memory. * * @note The allocated memory is filled with bytes of value zero. * * @param count is the number of objects to allocate. * * @param size is the size of one object to allocate. * * @return pointer to al

Source from the content-addressed store, hash-verified

910 * @return pointer to allocated memory / NULL pointer if there is an error.
911 */
912rt_weak void *rt_calloc(rt_size_t count, rt_size_t size)
913{
914 void *p;
915
916 /* allocate 'count' objects of size 'size' */
917 p = rt_malloc(count * size);
918 /* zero the memory */
919 if (p)
920 {
921 rt_memset(p, 0, count * size);
922 }
923 return p;
924}
925RTM_EXPORT(rt_calloc);
926
927/**

Callers 15

finsh_system_initFunction · 0.85
lwp_createFunction · 0.85
list_processFunction · 0.85
lwp_execve_setup_stdioFunction · 0.85
_sftx_createFunction · 0.85
list_channelFunction · 0.85
list_sessionFunction · 0.85
lwp_copy_filesFunction · 0.85
list_processgroupFunction · 0.85
lwp_tty_create_extFunction · 0.85
pts_allocFunction · 0.85

Calls 2

rt_mallocFunction · 0.85
rt_memsetFunction · 0.85

Tested by

no test coverage detected