From 20783635d4a6a1eb5fb9a1a5b9a78c7472284c62 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 7 Oct 2023 10:43:57 +0800 Subject: [PATCH] arch/sim: Remove the wrong comment from up_allocate_heap forget from https://github.com/apache/nuttx/pull/11043 Signed-off-by: Xiang Xiao --- arch/sim/src/sim/sim_heap.c | 15 ++------------- arch/sim/src/sim/sim_internal.h | 2 +- arch/sim/src/sim/win/sim_hostmemory.c | 4 ++-- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/arch/sim/src/sim/sim_heap.c b/arch/sim/src/sim/sim_heap.c index 79c5e4bd81..ac1828dcd8 100644 --- a/arch/sim/src/sim/sim_heap.c +++ b/arch/sim/src/sim/sim_heap.c @@ -213,7 +213,7 @@ static void mm_delayfree(struct mm_heap_s *heap, void *mem, bool delay) ****************************************************************************/ struct mm_heap_s *mm_initialize(const char *name, - void *heap_start, size_t heap_size) + void *heap_start, size_t heap_size) { struct mm_heap_s *heap; @@ -599,18 +599,7 @@ void up_allocate_heap(void **heap_start, size_t *heap_size) void up_allocate_heap(void **heap_start, size_t *heap_size) { - /* Note: Some subsystems like modlib and binfmt need to allocate - * executable memory. - */ - - /* We make the entire heap executable here to keep - * the sim simpler. If it turns out to be a problem, the - * ARCH_HAVE_TEXT_HEAP mechanism can be an alternative. - */ - - uint8_t *sim_heap = host_allocheap(SIM_HEAP_SIZE, false); - - *heap_start = sim_heap; + *heap_start = host_allocheap(SIM_HEAP_SIZE, false); *heap_size = SIM_HEAP_SIZE; } diff --git a/arch/sim/src/sim/sim_internal.h b/arch/sim/src/sim/sim_internal.h index c5869bfd3c..7b18ed4c32 100644 --- a/arch/sim/src/sim/sim_internal.h +++ b/arch/sim/src/sim/sim_internal.h @@ -216,7 +216,7 @@ int host_waitpid(pid_t pid); /* sim_hostmemory.c *********************************************************/ -void *host_allocheap(size_t sz, bool exec); +void *host_allocheap(size_t size, bool exec); void host_freeheap(void *mem); void *host_allocshmem(const char *name, size_t size, int master); void host_freeshmem(void *mem); diff --git a/arch/sim/src/sim/win/sim_hostmemory.c b/arch/sim/src/sim/win/sim_hostmemory.c index b900b9792d..3eaafa0006 100644 --- a/arch/sim/src/sim/win/sim_hostmemory.c +++ b/arch/sim/src/sim/win/sim_hostmemory.c @@ -36,9 +36,9 @@ * ****************************************************************************/ -void *host_allocheap(size_t sz, bool exec) +void *host_allocheap(size_t size, bool exec) { - return _aligned_malloc(sz, 8); + return _aligned_malloc(size, 8); } /****************************************************************************