mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
px4_nuttx_tasks:Support future removal of env.
CONFIG_DISABLE_ENVIRON can prevent task having to allocate memory for the env.
This commit is contained in:
1 parent
88d0b163b5
commit
e7bf0e03d2
1 file changed
+2
-2
@@ -71,14 +71,14 @@ int px4_task_spawn_cmd(const char *name, int scheduler, int priority, int stack_
|
||||
int pid;
|
||||
|
||||
sched_lock();
|
||||
|
||||
#if !defined(CONFIG_DISABLE_ENVIRON)
|
||||
/* None of the modules access the environment variables (via getenv() for instance), so delete them
|
||||
* all. They are only used within the startup script, and NuttX automatically exports them to the children
|
||||
* tasks.
|
||||
* This frees up a considerable amount of RAM.
|
||||
*/
|
||||
clearenv();
|
||||
|
||||
#endif
|
||||
/* create the task */
|
||||
pid = task_create(name, priority, stack_size, entry, argv);
|
||||
|
||||
|
||||
Reference in new issue
Block a user