FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2014 Threads] Single allocation for queuesPosted by hawk777 on February 14, 2014 I was wondering, right now, xQueueGenericCreate calls pvPortMalloc to allocate a Queuet, then calls it again to allocate the storage space for the queue data. If you have a lot of semaphores, this means a lot of calls to pvPortMalloc all asking for one-byte heap blocks, which will waste quite a bit of space on heap metadata! Wouldn’t it be more efficient to pack the Queuet and its data area into a single heap allocation, of size (sizeof(Queuet)+uxQueueLength*uxItemSize+1), and have the data area live immediately after the Queuet in RAM?
Single allocation for queuesPosted by rtel on February 14, 2014 I think this very topic was discussed a few months back, you might find it in the archive somewhere. Yes it is a good idea, but again because the code is so mature and known to be good at the moment there is some reluctance to make changes right now. Ideally it should have been done before the version 8 release candidates were provided for public review, but there is always very limited time and getting the new features out was priority. Again I would request a feature request is logged for this.
Regards.
Single allocation for queuesPosted by richard_damon on February 14, 2014 In general you can run into alignment problems with adding a data block after a structure like this, unless you use the C99 feature of being able to add a
type array[];
statement to the end of the structure. But since FreeRTOS only adds arrays of char to the end, and uses memmove (which can't have alignment issues) it should be safe.
I am not sure if it would cause problems with porting that change over to SafeRTOS, which I understand doesn't used dynamic allocations for stuff like this (but I suspect it needs a different interface anyway).
Single allocation for queuesPosted by hawk777 on February 16, 2014 OK, I have made a ticket. Thanks for the consideration!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|