diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2011-04-03 20:41:49 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2011-04-03 20:41:49 +0000 |
commit | 5fb8eb530ad4c493a0d6a6ac0f91b07bc8acb037 (patch) | |
tree | e689f42a002a2fd57548de0a3eb2aab98fe8f0f0 /nuttx/sched/env_dupenv.c | |
parent | 0fe79fa1bf4823f1c783ce7ddcb386e28f1dbb4e (diff) |
Move memory manager into user space
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3460 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/sched/env_dupenv.c')
-rw-r--r-- | nuttx/sched/env_dupenv.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nuttx/sched/env_dupenv.c b/nuttx/sched/env_dupenv.c index d11e44330b..fd3ccd7b70 100644 --- a/nuttx/sched/env_dupenv.c +++ b/nuttx/sched/env_dupenv.c @@ -1,7 +1,7 @@ /**************************************************************************** * eched/env_dupenv.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,9 @@ #include <sys/types.h> #include <sched.h> -#include <stdlib.h> + +#include <nuttx/kmalloc.h> + #include "os_internal.h" /**************************************************************************** @@ -91,7 +93,7 @@ FAR environ_t *dupenv(FAR _TCB *ptcb) /* Yes..The parent task has an environment, duplicate it */ size_t envlen = ptcb->envp->ev_alloc - envp = (environ_t*)malloc(SIZEOF_ENVIRON_T( envlen )); + envp = (environ_t*)kmalloc(SIZEOF_ENVIRON_T( envlen )); if (envp) { envp->ev_crefs = 1; @@ -99,6 +101,7 @@ FAR environ_t *dupenv(FAR _TCB *ptcb) memcmp( envp->ev_env, ptcb->envp->ev_env, envlen ); } } + sched_unlock(); return envp; } |