diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-01-28 03:38:53 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-01-28 03:38:53 +0000 |
commit | df9bb9b6ceace671da58c9ab9c4189a54b5cf484 (patch) | |
tree | bd072a074ab0c7662f121b023bfcb3b8652f12a4 /nuttx | |
parent | 028510756b30c476d8fc1d4fd44ddc231d504ee0 (diff) | |
download | px4-nuttx-df9bb9b6ceace671da58c9ab9c4189a54b5cf484.tar.gz px4-nuttx-df9bb9b6ceace671da58c9ab9c4189a54b5cf484.tar.bz2 px4-nuttx-df9bb9b6ceace671da58c9ab9c4189a54b5cf484.zip |
Don't clear stack unless debug is enabled
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2528 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/arch/arm/src/common/up_createstack.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/common/up_createstack.c b/nuttx/arch/arm/src/common/up_createstack.c index 32d76d47d..f56d36390 100644 --- a/nuttx/arch/arm/src/common/up_createstack.c +++ b/nuttx/arch/arm/src/common/up_createstack.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/common/up_createstack.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ #include <sys/types.h> #include <stdint.h> +#include <stdlib.h> #include <sched.h> #include <debug.h> @@ -95,7 +96,11 @@ int up_create_stack(_TCB *tcb, size_t stack_size) if (!tcb->stack_alloc_ptr) { - tcb->stack_alloc_ptr = (uint32_t*)kzmalloc(stack_size); +#ifdef CONFIG_DEBUG + tcb->stack_alloc_ptr = (uint32_t*)zalloc(stack_size); +#else + tcb->stack_alloc_ptr = (uint32_t*)malloc(stack_size); +#endif } if (tcb->stack_alloc_ptr) |