Skip to content

Issue 3763: Reduce heap allocation in the GCC linker file #4014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@ ENTRY(Reset_Handler)

__ram_vector_table__ = 1;

/* Heap 1/4 of ram and stack 1/8 */
__stack_size__ = 0x8000;
__heap_size__ = 0x10000;
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I asked already, just to be certain - this has no affect for mbed 2 apps (no RTOS) ? As its for GCC

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the mbed 2 tests with GCC work after this change.


/* This is the guaranteed minimum available heap size for an application. When
* uVisor is enabled, this is also the maximum available heap size. The
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
* heap and the page heap in uVisor applications. */
__heap_size__ = 0x6000;

HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ ENTRY(Reset_Handler)

__ram_vector_table__ = 1;

/* Heap 1/4 of ram and stack 1/8 */
__stack_size__ = 0x8000;
__heap_size__ = 0x10000;
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;

/* This is the guaranteed minimum available heap size for an application. When
* uVisor is enabled, this is also the maximum available heap size. The
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
* heap and the page heap in uVisor applications. */
__heap_size__ = 0x6000;

HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ ENTRY(Reset_Handler)

__ram_vector_table__ = 1;

/* Heap 1/4 of ram and stack 1/8 */
__stack_size__ = 0x800;
__heap_size__ = 0x1000;
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;
/* With the RTOS in use, this does not affect the main heap size. */
__heap_size__ = 0x0;

HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ ENTRY(Reset_Handler)

__ram_vector_table__ = 1;

/* Heap 1/4 of ram and stack 1/8 */
__stack_size__ = 0x1000;
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;

/* This is the guaranteed minimum available heap size for an application. When
* uVisor is enabled, this is also the maximum available heap size. The
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uvisor is not supported for these targets in this patch (most of them) ,and the comment makes reference to it. Shall be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left this allocation in heap in place just in case we decide to have uvisor on these targets in future.

* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
* heap and the page heap in uVisor applications. */
__heap_size__ = 0x2800;

HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ ENTRY(Reset_Handler)

__ram_vector_table__ = 1;

/* Heap 1/4 of ram and stack 1/8 */
__stack_size__ = 0x3000;
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;

/* This is the guaranteed minimum available heap size for an application. When
* uVisor is enabled, this is also the maximum available heap size. The
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
* heap and the page heap in uVisor applications. */
__heap_size__ = 0x6000;

HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ ENTRY(Reset_Handler)

__ram_vector_table__ = 1;

/* Heap 1/4 of ram and stack 1/8 */
__stack_size__ = 0x2000;
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;

/* This is the guaranteed minimum available heap size for an application. When
* uVisor is enabled, this is also the maximum available heap size. The
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
* heap and the page heap in uVisor applications. */
__heap_size__ = 0x4000;

HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ ENTRY(Reset_Handler)

__ram_vector_table__ = 1;

/* Heap 1/4 of ram and stack 1/8 */
__stack_size__ = 0x4000;
__heap_size__ = 0x8000;
/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;

/* This is the guaranteed minimum available heap size for an application. When
* uVisor is enabled, this is also the maximum available heap size. The
* HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
* heap and the page heap in uVisor applications. */
__heap_size__ = 0x6000;

HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
Expand Down