mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
Rename kmalloc to kmm_malloc for consistency
This commit is contained in:
@@ -124,7 +124,7 @@ EXEPATH_HANDLE exepath_init(void)
|
||||
|
||||
/* Allocate a container for the PATH variable contents */
|
||||
|
||||
exepath = (FAR struct exepath_s *)kmalloc(SIZEOF_EXEPATH_S(strlen(path) + 1));
|
||||
exepath = (FAR struct exepath_s *)kmm_malloc(SIZEOF_EXEPATH_S(strlen(path) + 1));
|
||||
if (!exepath)
|
||||
{
|
||||
/* Ooops.. we are out of memory */
|
||||
@@ -230,7 +230,7 @@ FAR char *exepath_next(EXEPATH_HANDLE handle, FAR const char *relpath)
|
||||
}
|
||||
|
||||
pathlen = strlen(path) + strlen(relpath) + 2;
|
||||
fullpath = (FAR char *)kmalloc(pathlen);
|
||||
fullpath = (FAR char *)kmm_malloc(pathlen);
|
||||
if (!fullpath)
|
||||
{
|
||||
/* Failed to allocate memory */
|
||||
|
||||
@@ -73,7 +73,7 @@ FAR struct binary_s *g_unloadhead;
|
||||
*
|
||||
* Description:
|
||||
* If CONFIG_SCHED_HAVE_PARENT is defined then schedul_unload() will
|
||||
* manage instances of struct binary_s allocated with kmalloc. It
|
||||
* manage instances of struct binary_s allocated with kmm_malloc. It
|
||||
* will keep the binary data in a link list and when SIGCHLD is received
|
||||
* (meaning that the task has exit'ed, schedul_unload() will find the
|
||||
* data, unload the module, and free the structure.
|
||||
@@ -82,7 +82,7 @@ FAR struct binary_s *g_unloadhead;
|
||||
*
|
||||
* Input Parameter:
|
||||
* pid - The task ID of the child task
|
||||
* bin - This structure must have been allocated with kmalloc() and must
|
||||
* bin - This structure must have been allocated with kmm_malloc() and must
|
||||
* persist until the task unloads
|
||||
|
||||
*
|
||||
@@ -116,7 +116,7 @@ static void unload_list_add(pid_t pid, FAR struct binary_s *bin)
|
||||
*
|
||||
* Description:
|
||||
* If CONFIG_SCHED_HAVE_PARENT is defined then schedul_unload() will
|
||||
* manage instances of struct binary_s allocated with kmalloc. It
|
||||
* manage instances of struct binary_s allocated with kmm_malloc. It
|
||||
* will keep the binary data in a link list and when SIGCHLD is received
|
||||
* (meaning that the task has exit'ed, schedul_unload() will find the
|
||||
* data, unload the module, and free the structure.
|
||||
@@ -187,7 +187,7 @@ static FAR struct binary_s *unload_list_remove(pid_t pid)
|
||||
* Description:
|
||||
* If CONFIG_SCHED_HAVE_PARENT is defined, this function may be called to
|
||||
* automatically unload the module when task exits. It assumes that
|
||||
* bin was allocated with kmalloc() or friends and will also automatically
|
||||
* bin was allocated with kmm_malloc() or friends and will also automatically
|
||||
* free the structure with kmm_free() when the task exists.
|
||||
*
|
||||
* Input Parameter:
|
||||
@@ -245,13 +245,13 @@ static void unload_callback(int signo, siginfo_t *info, void *ucontext)
|
||||
* If CONFIG_SCHED_HAVE_PARENT is defined, this function may be called by
|
||||
* the parent of the newly created task to automatically unload the
|
||||
* module when the task exits. This assumes that (1) the caller is the
|
||||
* parent of the created task, (2) that bin was allocated with kmalloc()
|
||||
* parent of the created task, (2) that bin was allocated with kmm_malloc()
|
||||
* or friends. It will also automatically free the structure with kmm_free()
|
||||
* after unloading the module.
|
||||
*
|
||||
* Input Parameter:
|
||||
* pid - The task ID of the child task
|
||||
* bin - This structure must have been allocated with kmalloc() and must
|
||||
* bin - This structure must have been allocated with kmm_malloc() and must
|
||||
* persist until the task unloads
|
||||
*
|
||||
* Returned Value:
|
||||
|
||||
@@ -84,7 +84,7 @@ int elf_allocbuffer(FAR struct elf_loadinfo_s *loadinfo)
|
||||
{
|
||||
/* No.. allocate one now */
|
||||
|
||||
loadinfo->iobuffer = (FAR uint8_t *)kmalloc(CONFIG_ELF_BUFFERSIZE);
|
||||
loadinfo->iobuffer = (FAR uint8_t *)kmm_malloc(CONFIG_ELF_BUFFERSIZE);
|
||||
if (!loadinfo->iobuffer)
|
||||
{
|
||||
bdbg("Failed to allocate an I/O buffer\n");
|
||||
|
||||
@@ -211,7 +211,7 @@ int elf_loadshdrs(FAR struct elf_loadinfo_s *loadinfo)
|
||||
|
||||
/* Allocate memory to hold a working copy of the sector header table */
|
||||
|
||||
loadinfo->shdr = (FAR Elf32_Shdr*)kmalloc(shdrsize);
|
||||
loadinfo->shdr = (FAR Elf32_Shdr*)kmm_malloc(shdrsize);
|
||||
if (!loadinfo->shdr)
|
||||
{
|
||||
bdbg("Failed to allocate the section header table. Size: %ld\n", (long)shdrsize);
|
||||
|
||||
@@ -95,7 +95,7 @@ int nxflat_addrenv_alloc(FAR struct nxflat_loadinfo_s *loadinfo, size_t envsize)
|
||||
|
||||
/* Allocate the struct dspace_s container for the D-Space allocation */
|
||||
|
||||
dspace = (FAR struct dspace_s *)kmalloc(sizeof(struct dspace_s));
|
||||
dspace = (FAR struct dspace_s *)kmm_malloc(sizeof(struct dspace_s));
|
||||
if (dspace == 0)
|
||||
{
|
||||
bdbg("ERROR: Failed to allocate DSpace\n");
|
||||
|
||||
Reference in New Issue
Block a user