# FreeRTOS TCP Buffer Allocation Scheme

**URL:** <https://forums.freertos.org/t/freertos-tcp-buffer-allocation-scheme/7313>\
**Category:** Kernel\
**Created:** [July 10, 2018, 7:25pm UTC](https://forums.freertos.org/t/freertos-tcp-buffer-allocation-scheme/7313 "2018-07-10T19:25:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 10, 2018, 7:25pm UTC](https://forums.freertos.org/t/freertos-tcp-buffer-allocation-scheme/7313/1 "2018-07-10T19:25:52Z")

</div>

**[koseng1](https://sourceforge.net/u/koseng1/)** wrote on [Tuesday, July 10, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/058e7ef4/#4db5):

Hello,

In the FreeRTOS TCP readme there is the following:

“At this time it is recommended to use BufferAllocation\_2.c in which case it is  
essential to use the heap\_4.c memory allocation scheme:  
[http://www.FreeRTOS.org/a00111.html](http://www.FreeRTOS.org/a00111.html)”

What were the specific reasons for this statement? Will BufferAllocation1.c eventually become obsolete? I thought 1.c was better if one was trying to avoid dynamic heap allocation. Is that still the case?

Thanks

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 10, 2018, 7:52pm UTC](https://forums.freertos.org/t/freertos-tcp-buffer-allocation-scheme/7313/2 "2018-07-10T19:52:07Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, July 10, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/058e7ef4/#4db5/2af1):

I’m not sure of the context. Can you please link to the page that text  
is cut from. There is no plan to obsolete BufferAllocation1.c -  
although it is a bit harder to use as you need to pre-allocate memory  
(sometimes within the network driver itself if the driver has certain  
memory alignment requirements).

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 10, 2018, 8:55pm UTC](https://forums.freertos.org/t/freertos-tcp-buffer-allocation-scheme/7313/3 "2018-07-10T20:55:54Z")

</div>

**[koseng1](https://sourceforge.net/u/koseng1/)** wrote on [Tuesday, July 10, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/058e7ef4/#4db5/2af1/8771):

[https://github.com/aws/amazon-freertos/blob/master/lib/FreeRTOS-Plus-TCP/source/readme.txt](https://github.com/aws/amazon-freertos/blob/master/lib/FreeRTOS-Plus-TCP/source/readme.txt)

Contents of the file:  
"  
Contains the files that implement FreeRTOS+TCP.

User documentation, including an API reference is available on:  
[http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS\_Plus\_TCP/](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/)

A description of the source code organisation is available on:  
[http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS\_Plus\_TCP/TCP\_Networking\_Tutorial.html](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html)

The porting guide is available on:  
[http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS\_Plus\_TCP/FreeRTOS\_TCP\_Porting.html](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_Porting.html)

License information is available on:  
[http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS\_Plus\_TCP/FreeRTOS\_Plus\_TCP\_License.html](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_Plus_TCP_License.html)

At this time it is recommended to use BufferAllocation\_2.c in which case it is  
essential to use the heap\_4.c memory allocation scheme:  
[http://www.FreeRTOS.org/a00111.html](http://www.FreeRTOS.org/a00111.html)  
"
