ccollins476ad closed pull request #890: Align heap base on an 8-byte offset.
URL: https://github.com/apache/mynewt-core/pull/890
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/hw/bsp/ada_feather_nrf52/ada_feather_nrf52_no_boot.ld 
b/hw/bsp/ada_feather_nrf52/ada_feather_nrf52_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/ada_feather_nrf52/ada_feather_nrf52_no_boot.ld
+++ b/hw/bsp/ada_feather_nrf52/ada_feather_nrf52_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/ada_feather_nrf52/split_ada_feather_nrf52.ld 
b/hw/bsp/ada_feather_nrf52/split_ada_feather_nrf52.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/ada_feather_nrf52/split_ada_feather_nrf52.ld
+++ b/hw/bsp/ada_feather_nrf52/split_ada_feather_nrf52.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/arduino_primo_nrf52/primo_no_boot.ld 
b/hw/bsp/arduino_primo_nrf52/primo_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/arduino_primo_nrf52/primo_no_boot.ld
+++ b/hw/bsp/arduino_primo_nrf52/primo_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/arduino_primo_nrf52/split-primo.ld 
b/hw/bsp/arduino_primo_nrf52/split-primo.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/arduino_primo_nrf52/split-primo.ld
+++ b/hw/bsp/arduino_primo_nrf52/split-primo.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/bbc_microbit/split-microbit.ld 
b/hw/bsp/bbc_microbit/split-microbit.ld
index 9c051f8e9..6df17d300 100755
--- a/hw/bsp/bbc_microbit/split-microbit.ld
+++ b/hw/bsp/bbc_microbit/split-microbit.ld
@@ -159,6 +159,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/ble400/ble400_no_boot.ld b/hw/bsp/ble400/ble400_no_boot.ld
index b5547fc34..07dd91e6f 100644
--- a/hw/bsp/ble400/ble400_no_boot.ld
+++ b/hw/bsp/ble400/ble400_no_boot.ld
@@ -154,6 +154,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/ble400/split-ble400.ld b/hw/bsp/ble400/split-ble400.ld
index 55d154e5e..4ac1f31e3 100644
--- a/hw/bsp/ble400/split-ble400.ld
+++ b/hw/bsp/ble400/split-ble400.ld
@@ -159,6 +159,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/bmd200/nrf51dk_no_boot.ld b/hw/bsp/bmd200/nrf51dk_no_boot.ld
index b5547fc34..07dd91e6f 100644
--- a/hw/bsp/bmd200/nrf51dk_no_boot.ld
+++ b/hw/bsp/bmd200/nrf51dk_no_boot.ld
@@ -154,6 +154,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/bmd200/split-nrf51dk.ld b/hw/bsp/bmd200/split-nrf51dk.ld
index 55d154e5e..4ac1f31e3 100644
--- a/hw/bsp/bmd200/split-nrf51dk.ld
+++ b/hw/bsp/bmd200/split-nrf51dk.ld
@@ -159,6 +159,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/bmd300eval/bmd300eval_no_boot.ld 
b/hw/bsp/bmd300eval/bmd300eval_no_boot.ld
index cd8d57034..7b7b3b7b9 100755
--- a/hw/bsp/bmd300eval/bmd300eval_no_boot.ld
+++ b/hw/bsp/bmd300eval/bmd300eval_no_boot.ld
@@ -170,6 +170,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/bmd300eval/split-bmd300eval.ld 
b/hw/bsp/bmd300eval/split-bmd300eval.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/bmd300eval/split-bmd300eval.ld
+++ b/hw/bsp/bmd300eval/split-bmd300eval.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/calliope_mini/split-calliope_mini.ld 
b/hw/bsp/calliope_mini/split-calliope_mini.ld
index a94e735ae..740e6977b 100755
--- a/hw/bsp/calliope_mini/split-calliope_mini.ld
+++ b/hw/bsp/calliope_mini/split-calliope_mini.ld
@@ -159,6 +159,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/dwm1001-dev/dwm1001-dev_no_boot.ld 
b/hw/bsp/dwm1001-dev/dwm1001-dev_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/dwm1001-dev/dwm1001-dev_no_boot.ld
+++ b/hw/bsp/dwm1001-dev/dwm1001-dev_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/dwm1001-dev/split-dwm1001-dev.ld 
b/hw/bsp/dwm1001-dev/split-dwm1001-dev.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/dwm1001-dev/split-dwm1001-dev.ld
+++ b/hw/bsp/dwm1001-dev/split-dwm1001-dev.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/embarc_emsk/arc_core.ld b/hw/bsp/embarc_emsk/arc_core.ld
index f1881ce3f..5d9a3d740 100644
--- a/hw/bsp/embarc_emsk/arc_core.ld
+++ b/hw/bsp/embarc_emsk/arc_core.ld
@@ -111,7 +111,7 @@ SECTIONS
     } > DCCM
 
     /* Allocate remaining RAM (RAM between _e_bss and __StackLimit to heap */
-    . = ALIGN(4);
+    . = ALIGN(8);
     __HeapBase = .;
 
     __StackTop = ORIGIN(DCCM) + LENGTH(DCCM);
diff --git a/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld 
b/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld
index 838e64db9..6f3aa2e6d 100644
--- a/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld
+++ b/hw/bsp/frdm-k64f/MK64FN1M0xxx12_flash.ld
@@ -232,6 +232,7 @@ SECTIONS
     . = ALIGN(8);
     __end__ = .;
     PROVIDE(end = .);
+    . = ALIGN(8);
     __HeapBase = .;
     . += HEAP_SIZE;
     __HeapLimit = .;
diff --git a/hw/bsp/frdm-k64f/boot-MK64FN1M0xxx12_flash.ld 
b/hw/bsp/frdm-k64f/boot-MK64FN1M0xxx12_flash.ld
index 9f5da7075..4c2b41fd8 100644
--- a/hw/bsp/frdm-k64f/boot-MK64FN1M0xxx12_flash.ld
+++ b/hw/bsp/frdm-k64f/boot-MK64FN1M0xxx12_flash.ld
@@ -227,6 +227,7 @@ SECTIONS
     . = ALIGN(8);
     __end__ = .;
     PROVIDE(end = .);
+    . = ALIGN(8);
     __HeapBase = .;
     . += HEAP_SIZE;
     __HeapLimit = .;
diff --git a/hw/bsp/nina-b1/nrf52dk_no_boot.ld 
b/hw/bsp/nina-b1/nrf52dk_no_boot.ld
index e2fb5a8c6..a63e5985b 100644
--- a/hw/bsp/nina-b1/nrf52dk_no_boot.ld
+++ b/hw/bsp/nina-b1/nrf52dk_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nina-b1/split-nrf52dk.ld b/hw/bsp/nina-b1/split-nrf52dk.ld
index ebfac21f4..81bc25191 100644
--- a/hw/bsp/nina-b1/split-nrf52dk.ld
+++ b/hw/bsp/nina-b1/split-nrf52dk.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf51-arduino_101/nrf51dk-16kbram_no_boot.ld 
b/hw/bsp/nrf51-arduino_101/nrf51dk-16kbram_no_boot.ld
index 133ba36ad..ddefd5631 100755
--- a/hw/bsp/nrf51-arduino_101/nrf51dk-16kbram_no_boot.ld
+++ b/hw/bsp/nrf51-arduino_101/nrf51dk-16kbram_no_boot.ld
@@ -154,6 +154,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf51-blenano/nrf51dk_no_boot.ld 
b/hw/bsp/nrf51-blenano/nrf51dk_no_boot.ld
index b5547fc34..07dd91e6f 100755
--- a/hw/bsp/nrf51-blenano/nrf51dk_no_boot.ld
+++ b/hw/bsp/nrf51-blenano/nrf51dk_no_boot.ld
@@ -154,6 +154,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf51-blenano/split-nrf51dk.ld 
b/hw/bsp/nrf51-blenano/split-nrf51dk.ld
index 55d154e5e..4ac1f31e3 100755
--- a/hw/bsp/nrf51-blenano/split-nrf51dk.ld
+++ b/hw/bsp/nrf51-blenano/split-nrf51dk.ld
@@ -159,6 +159,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_no_boot.ld 
b/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_no_boot.ld
index 3c1233540..f177f99bc 100755
--- a/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_no_boot.ld
+++ b/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_no_boot.ld
@@ -154,6 +154,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf51dk-16kbram/split-nrf51dk-16kbram.ld 
b/hw/bsp/nrf51dk-16kbram/split-nrf51dk-16kbram.ld
index 9c051f8e9..6df17d300 100755
--- a/hw/bsp/nrf51dk-16kbram/split-nrf51dk-16kbram.ld
+++ b/hw/bsp/nrf51dk-16kbram/split-nrf51dk-16kbram.ld
@@ -159,6 +159,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf51dk/nrf51dk_no_boot.ld 
b/hw/bsp/nrf51dk/nrf51dk_no_boot.ld
index b5547fc34..07dd91e6f 100755
--- a/hw/bsp/nrf51dk/nrf51dk_no_boot.ld
+++ b/hw/bsp/nrf51dk/nrf51dk_no_boot.ld
@@ -154,6 +154,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf51dk/split-nrf51dk.ld b/hw/bsp/nrf51dk/split-nrf51dk.ld
index 55d154e5e..4ac1f31e3 100755
--- a/hw/bsp/nrf51dk/split-nrf51dk.ld
+++ b/hw/bsp/nrf51dk/split-nrf51dk.ld
@@ -159,6 +159,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf52-thingy/nrf52-thingy_no_boot.ld 
b/hw/bsp/nrf52-thingy/nrf52-thingy_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/nrf52-thingy/nrf52-thingy_no_boot.ld
+++ b/hw/bsp/nrf52-thingy/nrf52-thingy_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf52-thingy/split-nrf52-thingy.ld 
b/hw/bsp/nrf52-thingy/split-nrf52-thingy.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/nrf52-thingy/split-nrf52-thingy.ld
+++ b/hw/bsp/nrf52-thingy/split-nrf52-thingy.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf52840pdk/nrf52840pdk_no_boot.ld 
b/hw/bsp/nrf52840pdk/nrf52840pdk_no_boot.ld
index 8ae27ec54..3a399590a 100755
--- a/hw/bsp/nrf52840pdk/nrf52840pdk_no_boot.ld
+++ b/hw/bsp/nrf52840pdk/nrf52840pdk_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf52840pdk/split-nrf52840pdk.ld 
b/hw/bsp/nrf52840pdk/split-nrf52840pdk.ld
index 1985aa1c4..047e4fd7b 100755
--- a/hw/bsp/nrf52840pdk/split-nrf52840pdk.ld
+++ b/hw/bsp/nrf52840pdk/split-nrf52840pdk.ld
@@ -177,6 +177,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf52dk/nrf52dk_no_boot.ld 
b/hw/bsp/nrf52dk/nrf52dk_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/nrf52dk/nrf52dk_no_boot.ld
+++ b/hw/bsp/nrf52dk/nrf52dk_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/nrf52dk/split-nrf52dk.ld b/hw/bsp/nrf52dk/split-nrf52dk.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/nrf52dk/split-nrf52dk.ld
+++ b/hw/bsp/nrf52dk/split-nrf52dk.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/olimex_stm32-e407_devboard/run_from_sram.ld 
b/hw/bsp/olimex_stm32-e407_devboard/run_from_sram.ld
index 04e3f9000..5d0861853 100755
--- a/hw/bsp/olimex_stm32-e407_devboard/run_from_sram.ld
+++ b/hw/bsp/olimex_stm32-e407_devboard/run_from_sram.ld
@@ -180,6 +180,7 @@ SECTIONS
         __bss_end__ = .;
     } > RAM
 
+    . = ALIGN(8);
     __HeapBase = .;
     __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
 
diff --git a/hw/bsp/puckjs/puckjs_no_boot.ld b/hw/bsp/puckjs/puckjs_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/puckjs/puckjs_no_boot.ld
+++ b/hw/bsp/puckjs/puckjs_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/puckjs/split_puckjs.ld b/hw/bsp/puckjs/split_puckjs.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/puckjs/split_puckjs.ld
+++ b/hw/bsp/puckjs/split_puckjs.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/rb-blend2/rb-blend2_no_boot.ld 
b/hw/bsp/rb-blend2/rb-blend2_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/rb-blend2/rb-blend2_no_boot.ld
+++ b/hw/bsp/rb-blend2/rb-blend2_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/rb-blend2/split-rb-blend2.ld 
b/hw/bsp/rb-blend2/split-rb-blend2.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/rb-blend2/split-rb-blend2.ld
+++ b/hw/bsp/rb-blend2/split-rb-blend2.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/rb-nano2/rb-nano2_no_boot.ld 
b/hw/bsp/rb-nano2/rb-nano2_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/rb-nano2/rb-nano2_no_boot.ld
+++ b/hw/bsp/rb-nano2/rb-nano2_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/rb-nano2/split-rb-nano2.ld 
b/hw/bsp/rb-nano2/split-rb-nano2.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/rb-nano2/split-rb-nano2.ld
+++ b/hw/bsp/rb-nano2/split-rb-nano2.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/ruuvi_tag_revb2/nrf52dk_no_boot.ld 
b/hw/bsp/ruuvi_tag_revb2/nrf52dk_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/ruuvi_tag_revb2/nrf52dk_no_boot.ld
+++ b/hw/bsp/ruuvi_tag_revb2/nrf52dk_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/ruuvi_tag_revb2/split-nrf52dk.ld 
b/hw/bsp/ruuvi_tag_revb2/split-nrf52dk.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/ruuvi_tag_revb2/split-nrf52dk.ld
+++ b/hw/bsp/ruuvi_tag_revb2/split-nrf52dk.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/telee02/split-telee02.ld b/hw/bsp/telee02/split-telee02.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/telee02/split-telee02.ld
+++ b/hw/bsp/telee02/split-telee02.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/telee02/telee02_no_boot.ld 
b/hw/bsp/telee02/telee02_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/telee02/telee02_no_boot.ld
+++ b/hw/bsp/telee02/telee02_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/usbmkw41z/boot-mkw41z512.ld 
b/hw/bsp/usbmkw41z/boot-mkw41z512.ld
index 94d25e7f1..ed9b12d30 100644
--- a/hw/bsp/usbmkw41z/boot-mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/boot-mkw41z512.ld
@@ -170,6 +170,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/usbmkw41z/mkw41z512.ld b/hw/bsp/usbmkw41z/mkw41z512.ld
index f0e63b4b2..b728b23dc 100644
--- a/hw/bsp/usbmkw41z/mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/mkw41z512.ld
@@ -160,6 +160,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld 
b/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld
index 8f2e0ad34..c89ffa2d1 100644
--- a/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld
+++ b/hw/bsp/usbmkw41z/no-boot-mkw41z512.ld
@@ -170,6 +170,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/vbluno51/split-vbluno51.ld 
b/hw/bsp/vbluno51/split-vbluno51.ld
index 55d154e5e..4ac1f31e3 100755
--- a/hw/bsp/vbluno51/split-vbluno51.ld
+++ b/hw/bsp/vbluno51/split-vbluno51.ld
@@ -159,6 +159,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/vbluno51/vbluno51_no_boot.ld 
b/hw/bsp/vbluno51/vbluno51_no_boot.ld
index b5547fc34..07dd91e6f 100755
--- a/hw/bsp/vbluno51/vbluno51_no_boot.ld
+++ b/hw/bsp/vbluno51/vbluno51_no_boot.ld
@@ -154,6 +154,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/vbluno52/split-vbluno52.ld 
b/hw/bsp/vbluno52/split-vbluno52.ld
index f4ffe5a1c..696b6c416 100755
--- a/hw/bsp/vbluno52/split-vbluno52.ld
+++ b/hw/bsp/vbluno52/split-vbluno52.ld
@@ -181,6 +181,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/bsp/vbluno52/vbluno52_no_boot.ld 
b/hw/bsp/vbluno52/vbluno52_no_boot.ld
index e2fb5a8c6..a63e5985b 100755
--- a/hw/bsp/vbluno52/vbluno52_no_boot.ld
+++ b/hw/bsp/vbluno52/vbluno52_no_boot.ld
@@ -166,6 +166,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/mcu/ambiq/apollo2/apollo2.ld b/hw/mcu/ambiq/apollo2/apollo2.ld
index aaeed7a11..d4cf94e46 100755
--- a/hw/mcu/ambiq/apollo2/apollo2.ld
+++ b/hw/mcu/ambiq/apollo2/apollo2.ld
@@ -169,6 +169,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/mcu/nordic/nrf51xxx/nrf51.ld b/hw/mcu/nordic/nrf51xxx/nrf51.ld
index 415ca9247..354c19352 100755
--- a/hw/mcu/nordic/nrf51xxx/nrf51.ld
+++ b/hw/mcu/nordic/nrf51xxx/nrf51.ld
@@ -153,6 +153,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/mcu/nordic/nrf52xxx/nrf52.ld b/hw/mcu/nordic/nrf52xxx/nrf52.ld
index d60421fbe..447b5582b 100755
--- a/hw/mcu/nordic/nrf52xxx/nrf52.ld
+++ b/hw/mcu/nordic/nrf52xxx/nrf52.ld
@@ -169,6 +169,7 @@ SECTIONS
     } > RAM
 
     /* Heap starts after BSS */
+    . = ALIGN(8);
     __HeapBase = .;
 
     /* .stack_dummy section doesn't contains any symbols. It is only
diff --git a/hw/mcu/stm/stm32f1xx/stm32f103.ld 
b/hw/mcu/stm/stm32f1xx/stm32f103.ld
index ceff46128..7d2dbf553 100644
--- a/hw/mcu/stm/stm32f1xx/stm32f103.ld
+++ b/hw/mcu/stm/stm32f1xx/stm32f103.ld
@@ -187,6 +187,7 @@ SECTIONS
         __bss_end__ = _ebss;
     } > RAM
 
+    . = ALIGN(8);
     __HeapBase = .;
     __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
 
diff --git a/hw/mcu/stm/stm32f3xx/stm32f303.ld 
b/hw/mcu/stm/stm32f3xx/stm32f303.ld
index 33e083164..8b35c4ff9 100644
--- a/hw/mcu/stm/stm32f3xx/stm32f303.ld
+++ b/hw/mcu/stm/stm32f3xx/stm32f303.ld
@@ -185,6 +185,7 @@ SECTIONS
         _ebss = .;
     } > SRAM
 
+    . = ALIGN(8);
     __HeapBase = .;
     __HeapLimit = ORIGIN(SRAM) + LENGTH(SRAM);
 
diff --git a/hw/mcu/stm/stm32f4xx/stm32f401.ld 
b/hw/mcu/stm/stm32f4xx/stm32f401.ld
index f01557ea6..138842616 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f401.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f401.ld
@@ -178,6 +178,7 @@ SECTIONS
         __bss_end__ = .;
     } > RAM
 
+    . = ALIGN(8);
     __HeapBase = .;
     __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
 
diff --git a/hw/mcu/stm/stm32f4xx/stm32f407.ld 
b/hw/mcu/stm/stm32f4xx/stm32f407.ld
index 7d2887a06..a26de2ad0 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f407.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f407.ld
@@ -178,6 +178,7 @@ SECTIONS
         __bss_end__ = .;
     } > RAM
 
+    . = ALIGN(8);
     __HeapBase = .;
     __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
 
diff --git a/hw/mcu/stm/stm32f4xx/stm32f427.ld 
b/hw/mcu/stm/stm32f4xx/stm32f427.ld
index 7d2887a06..a26de2ad0 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f427.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f427.ld
@@ -178,6 +178,7 @@ SECTIONS
         __bss_end__ = .;
     } > RAM
 
+    . = ALIGN(8);
     __HeapBase = .;
     __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
 
diff --git a/hw/mcu/stm/stm32f4xx/stm32f429.ld 
b/hw/mcu/stm/stm32f4xx/stm32f429.ld
index 022ba9aa4..5f757be77 100644
--- a/hw/mcu/stm/stm32f4xx/stm32f429.ld
+++ b/hw/mcu/stm/stm32f4xx/stm32f429.ld
@@ -185,6 +185,7 @@ SECTIONS
         _ebss = .;
     } > RAM
 
+    . = ALIGN(8);
     __HeapBase = .;
     __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
 
diff --git a/hw/mcu/stm/stm32f7xx/stm32f746.ld 
b/hw/mcu/stm/stm32f7xx/stm32f746.ld
index 1afc22b96..d0d31fb77 100644
--- a/hw/mcu/stm/stm32f7xx/stm32f746.ld
+++ b/hw/mcu/stm/stm32f7xx/stm32f746.ld
@@ -187,6 +187,7 @@ SECTIONS
         __bss_end__ = _ebss;
     } > RAM
 
+    . = ALIGN(8);
     __HeapBase = .;
     __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
 
diff --git a/hw/mcu/stm/stm32f7xx/stm32f767.ld 
b/hw/mcu/stm/stm32f7xx/stm32f767.ld
index 9e06f17bf..81e78063d 100644
--- a/hw/mcu/stm/stm32f7xx/stm32f767.ld
+++ b/hw/mcu/stm/stm32f7xx/stm32f767.ld
@@ -187,6 +187,7 @@ SECTIONS
         __bss_end__ = _ebss;
     } > RAM
 
+    . = ALIGN(8);
     __HeapBase = .;
     __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
 
diff --git a/hw/mcu/stm/stm32l1xx/stm32l152.ld 
b/hw/mcu/stm/stm32l1xx/stm32l152.ld
index 86ecc0934..a79b769c0 100644
--- a/hw/mcu/stm/stm32l1xx/stm32l152.ld
+++ b/hw/mcu/stm/stm32l1xx/stm32l152.ld
@@ -187,6 +187,7 @@ SECTIONS
         __bss_end__ = _ebss;
     } > RAM
 
+    . = ALIGN(8);
     __HeapBase = .;
     __HeapLimit = ORIGIN(RAM) + LENGTH(RAM);
 
diff --git a/libc/baselibc/src/malloc.c b/libc/baselibc/src/malloc.c
index 3ef5089d6..c00b08892 100644
--- a/libc/baselibc/src/malloc.c
+++ b/libc/baselibc/src/malloc.c
@@ -13,14 +13,14 @@
    list with head node.  This the head node. Note that the arena list
    is sorted in order of address. */
 static struct free_arena_header __malloc_head = {
-       {
-               ARENA_TYPE_HEAD,
-               0,
-               &__malloc_head,
-               &__malloc_head,
-       },
-       &__malloc_head,
-       &__malloc_head
+    {
+        ARENA_TYPE_HEAD,
+        0,
+        &__malloc_head,
+        &__malloc_head,
+    },
+    &__malloc_head,
+    &__malloc_head
 };
 
 static bool malloc_lock_nop() {return true;}
@@ -32,213 +32,213 @@ static malloc_unlock_t malloc_unlock = &malloc_unlock_nop;
 static inline void mark_block_dead(struct free_arena_header *ah)
 {
 #ifdef DEBUG_MALLOC
-       ah->a.type = ARENA_TYPE_DEAD;
+    ah->a.type = ARENA_TYPE_DEAD;
 #endif
 }
 
 static inline void remove_from_main_chain(struct free_arena_header *ah)
 {
-       struct free_arena_header *ap, *an;
+    struct free_arena_header *ap, *an;
 
-       mark_block_dead(ah);
+    mark_block_dead(ah);
 
-       ap = ah->a.prev;
-       an = ah->a.next;
-       ap->a.next = an;
-       an->a.prev = ap;
+    ap = ah->a.prev;
+    an = ah->a.next;
+    ap->a.next = an;
+    an->a.prev = ap;
 }
 
 static inline void remove_from_free_chain(struct free_arena_header *ah)
 {
-       struct free_arena_header *ap, *an;
+    struct free_arena_header *ap, *an;
 
-       ap = ah->prev_free;
-       an = ah->next_free;
-       ap->next_free = an;
-       an->prev_free = ap;
+    ap = ah->prev_free;
+    an = ah->next_free;
+    ap->next_free = an;
+    an->prev_free = ap;
 }
 
 static inline void remove_from_chains(struct free_arena_header *ah)
 {
-       remove_from_free_chain(ah);
-       remove_from_main_chain(ah);
+    remove_from_free_chain(ah);
+    remove_from_main_chain(ah);
 }
 
 static void *__malloc_from_block(struct free_arena_header *fp, size_t size)
 {
-       size_t fsize;
-       struct free_arena_header *nfp, *na, *fpn, *fpp;
-
-       fsize = fp->a.size;
-
-       /* We need the 2* to account for the larger requirements of a
-          free block */
-       if (fsize >= size + 2 * sizeof(struct arena_header)) {
-               /* Bigger block than required -- split block */
-               nfp = (struct free_arena_header *)((char *)fp + size);
-               na = fp->a.next;
-
-               nfp->a.type = ARENA_TYPE_FREE;
-               nfp->a.size = fsize - size;
-               fp->a.type = ARENA_TYPE_USED;
-               fp->a.size = size;
-
-               /* Insert into all-block chain */
-               nfp->a.prev = fp;
-               nfp->a.next = na;
-               na->a.prev = nfp;
-               fp->a.next = nfp;
-
-               /* Replace current block on free chain */
-               nfp->next_free = fpn = fp->next_free;
-               nfp->prev_free = fpp = fp->prev_free;
-               fpn->prev_free = nfp;
-               fpp->next_free = nfp;
-       } else {
-               fp->a.type = ARENA_TYPE_USED; /* Allocate the whole block */
-               remove_from_free_chain(fp);
-       }
-
-       return (void *)(&fp->a + 1);
+    size_t fsize;
+    struct free_arena_header *nfp, *na, *fpn, *fpp;
+
+    fsize = fp->a.size;
+
+    /* We need the 2* to account for the larger requirements of a
+       free block */
+    if (fsize >= size + 2 * sizeof(struct arena_header)) {
+        /* Bigger block than required -- split block */
+        nfp = (struct free_arena_header *)((char *)fp + size);
+        na = fp->a.next;
+
+        nfp->a.type = ARENA_TYPE_FREE;
+        nfp->a.size = fsize - size;
+        fp->a.type = ARENA_TYPE_USED;
+        fp->a.size = size;
+
+        /* Insert into all-block chain */
+        nfp->a.prev = fp;
+        nfp->a.next = na;
+        na->a.prev = nfp;
+        fp->a.next = nfp;
+
+        /* Replace current block on free chain */
+        nfp->next_free = fpn = fp->next_free;
+        nfp->prev_free = fpp = fp->prev_free;
+        fpn->prev_free = nfp;
+        fpp->next_free = nfp;
+    } else {
+        fp->a.type = ARENA_TYPE_USED; /* Allocate the whole block */
+        remove_from_free_chain(fp);
+    }
+
+    return (void *)(&fp->a + 1);
 }
 
 static struct free_arena_header *__free_block(struct free_arena_header *ah)
 {
-       struct free_arena_header *pah, *nah;
-
-       pah = ah->a.prev;
-       nah = ah->a.next;
-       if (pah->a.type == ARENA_TYPE_FREE &&
-           (char *)pah + pah->a.size == (char *)ah) {
-               /* Coalesce into the previous block */
-               pah->a.size += ah->a.size;
-               pah->a.next = nah;
-               nah->a.prev = pah;
-               mark_block_dead(ah);
-
-               ah = pah;
-               pah = ah->a.prev;
-       } else {
-               /* Need to add this block to the free chain */
-               ah->a.type = ARENA_TYPE_FREE;
-
-               ah->next_free = __malloc_head.next_free;
-               ah->prev_free = &__malloc_head;
-               __malloc_head.next_free = ah;
-               ah->next_free->prev_free = ah;
-       }
-
-       /* In either of the previous cases, we might be able to merge
-          with the subsequent block... */
-       if (nah->a.type == ARENA_TYPE_FREE &&
-           (char *)ah + ah->a.size == (char *)nah) {
-               ah->a.size += nah->a.size;
-
-               /* Remove the old block from the chains */
-               remove_from_chains(nah);
-       }
-
-       /* Return the block that contains the called block */
-       return ah;
+    struct free_arena_header *pah, *nah;
+
+    pah = ah->a.prev;
+    nah = ah->a.next;
+    if (pah->a.type == ARENA_TYPE_FREE &&
+        (char *)pah + pah->a.size == (char *)ah) {
+        /* Coalesce into the previous block */
+        pah->a.size += ah->a.size;
+        pah->a.next = nah;
+        nah->a.prev = pah;
+        mark_block_dead(ah);
+
+        ah = pah;
+        pah = ah->a.prev;
+    } else {
+        /* Need to add this block to the free chain */
+        ah->a.type = ARENA_TYPE_FREE;
+
+        ah->next_free = __malloc_head.next_free;
+        ah->prev_free = &__malloc_head;
+        __malloc_head.next_free = ah;
+        ah->next_free->prev_free = ah;
+    }
+
+    /* In either of the previous cases, we might be able to merge
+       with the subsequent block... */
+    if (nah->a.type == ARENA_TYPE_FREE &&
+        (char *)ah + ah->a.size == (char *)nah) {
+        ah->a.size += nah->a.size;
+
+        /* Remove the old block from the chains */
+        remove_from_chains(nah);
+    }
+
+    /* Return the block that contains the called block */
+    return ah;
 }
 
 void *malloc(size_t size)
 {
-       struct free_arena_header *fp;
-        void *more_mem;
-        extern void *_sbrk(int incr);
+    struct free_arena_header *fp;
+    void *more_mem;
+    extern void *_sbrk(int incr);
 
-       if (size == 0)
-               return NULL;
+    if (size == 0)
+        return NULL;
 
-       /* Add the obligatory arena header, and round up */
-       size = (size + 2 * sizeof(struct arena_header) - 1) & ARENA_SIZE_MASK;
+    /* Add the obligatory arena header, and round up */
+    size = (size + 2 * sizeof(struct arena_header) - 1) & ARENA_SIZE_MASK;
 
-        if (!malloc_lock())
-                return NULL;
+    if (!malloc_lock())
+        return NULL;
 
-        void *result = NULL;
+    void *result = NULL;
 retry_alloc:
-       for (fp = __malloc_head.next_free; fp->a.type != ARENA_TYPE_HEAD;
-            fp = fp->next_free) {
-               if (fp->a.size >= size) {
-                       /* Found fit -- allocate out of this block */
-                       result = __malloc_from_block(fp, size);
-                        break;
-               }
-       }
-        if (result == NULL) {
-            more_mem = _sbrk(size);
-            if (more_mem != (void *)-1) {
-                add_malloc_block(more_mem, size);
-                goto retry_alloc;
-            }
+    for (fp = __malloc_head.next_free; fp->a.type != ARENA_TYPE_HEAD;
+         fp = fp->next_free) {
+        if (fp->a.size >= size) {
+            /* Found fit -- allocate out of this block */
+            result = __malloc_from_block(fp, size);
+            break;
         }
-        malloc_unlock();
-       return result;
+    }
+    if (result == NULL) {
+        more_mem = _sbrk(size);
+        if (more_mem != (void *)-1) {
+            add_malloc_block(more_mem, size);
+            goto retry_alloc;
+        }
+    }
+    malloc_unlock();
+    return result;
 }
 
 /* Call this to give malloc some memory to allocate from */
 void add_malloc_block(void *buf, size_t size)
 {
-       struct free_arena_header *fp = buf;
-       struct free_arena_header *pah;
-
-       if (size < sizeof(struct free_arena_header))
-               return; // Too small.
-
-       /* Insert the block into the management chains.  We need to set
-          up the size and the main block list pointer, the rest of
-          the work is logically identical to free(). */
-       fp->a.type = ARENA_TYPE_FREE;
-       fp->a.size = size;
-
-        if (!malloc_lock())
-            return;
-
-       /* We need to insert this into the main block list in the proper
-          place -- this list is required to be sorted.  Since we most likely
-          get memory assignments in ascending order, search backwards for
-          the proper place. */
-       for (pah = __malloc_head.a.prev; pah->a.type != ARENA_TYPE_HEAD;
-            pah = pah->a.prev) {
-               if (pah < fp)
-                       break;
-       }
-
-       /* Now pah points to the node that should be the predecessor of
-          the new node */
-       fp->a.next = pah->a.next;
-       fp->a.prev = pah;
-       pah->a.next = fp;
-       fp->a.next->a.prev = fp;
-
-       /* Insert into the free chain and coalesce with adjacent blocks */
-       fp = __free_block(fp);
-
-        malloc_unlock();
+    struct free_arena_header *fp = buf;
+    struct free_arena_header *pah;
+
+    if (size < sizeof(struct free_arena_header))
+        return; // Too small.
+
+    /* Insert the block into the management chains.  We need to set
+       up the size and the main block list pointer, the rest of
+       the work is logically identical to free(). */
+    fp->a.type = ARENA_TYPE_FREE;
+    fp->a.size = size;
+
+    if (!malloc_lock())
+        return;
+
+    /* We need to insert this into the main block list in the proper
+       place -- this list is required to be sorted.  Since we most likely
+       get memory assignments in ascending order, search backwards for
+       the proper place. */
+    for (pah = __malloc_head.a.prev; pah->a.type != ARENA_TYPE_HEAD;
+         pah = pah->a.prev) {
+        if (pah < fp)
+            break;
+    }
+
+    /* Now pah points to the node that should be the predecessor of
+       the new node */
+    fp->a.next = pah->a.next;
+    fp->a.prev = pah;
+    pah->a.next = fp;
+    fp->a.next->a.prev = fp;
+
+    /* Insert into the free chain and coalesce with adjacent blocks */
+    fp = __free_block(fp);
+
+    malloc_unlock();
 }
 
 void free(void *ptr)
 {
-       struct free_arena_header *ah;
+    struct free_arena_header *ah;
 
-       if (!ptr)
-               return;
+    if (!ptr)
+        return;
 
-       ah = (struct free_arena_header *)
-           ((struct arena_header *)ptr - 1);
+    ah = (struct free_arena_header *)
+        ((struct arena_header *)ptr - 1);
 
 #ifdef DEBUG_MALLOC
-       assert(ah->a.type == ARENA_TYPE_USED);
+    assert(ah->a.type == ARENA_TYPE_USED);
 #endif
 
-        if (!malloc_lock())
-            return;
+    if (!malloc_lock())
+        return;
 
-       /* Merge into adjacent free blocks */
-       ah = __free_block(ah);
-        malloc_unlock();
+    /* Merge into adjacent free blocks */
+    ah = __free_block(ah);
+    malloc_unlock();
 }
 
 void get_malloc_memory_status(size_t *free_bytes, size_t *largest_block)
@@ -248,7 +248,7 @@ void get_malloc_memory_status(size_t *free_bytes, size_t 
*largest_block)
     *largest_block = 0;
 
     if (!malloc_lock())
-            return;
+        return;
 
     for (fp = __malloc_head.next_free; fp->a.type != ARENA_TYPE_HEAD; fp = 
fp->next_free) {
         *free_bytes += fp->a.size;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to