tlsf: [PATCH] Use the low bits of bhdr_t.prev_hdr to check for errors

Applied commit from https://github.com/ndantam/tlsfmalloc:

From 2d7a980b887e8a33754a7660f41ea5ebf7d5c88a Mon Sep 17 00:00:00 2001
From: "Neil T. Dantam" <ntd@gatech.edu>
Date: Wed, 13 Nov 2013 00:41:15 -0500
Subject: [PATCH] Use the low bits of bhdr_t.prev_hdr to check for errors

* The low bits of prev_hdr field should contain the complement of the
  low bits of the size field.
* When this is not the case, it indicates heap corruption or a
  programming error
* Alternatively, or additionally, we could use parity bits for error
  checking
tlsf: [PATCH] Cast pointers via union on GCC

Applied commit from https://github.com/ndantam/tlsfmalloc:

From eadf5d0bfd247b43833a6042ca3ecac4f9d2cdeb Mon Sep 17 00:00:00 2001
From: "Neil T. Dantam" <ntd@gatech.edu>
Date: Tue, 19 Nov 2013 19:07:52 -0500
Subject: [PATCH] Cast pointers via union on GCC
tlsf: compile with -no-strict-aliasing flag

Signed-off-by: Ruben Smits <ruben.smits@intermodalics.eu>
tlsf: cast to intptr type before doing the bytewise operation

solves compilation errors with gcc-4.8 and XCode 5.1

Signed-off-by: Ruben Smits <ruben.smits@intermodalics.eu>
Revert "tlsf: use safer init detection flag."

This reverts commit e2327e0fe1d0e07d5a8c3d1175a06999d97319a2. This commit prevents the use of multiple memory pools, (only accessible through the free/malloc_ex).
tlsf: use the first initialized memory pool as the static memorypool, to avoid corrupting previously allocated memory

Signed-off-by: Ruben Smits <ruben.smits@intermodalics.eu>
tlsf: add unit test for tlsf

Signed-off-by: Ruben Smits <ruben.smits@intermodalics.eu>
tlsf: calculate BLOCK_SIZE in a way that:

* is more readable
* is correct on Mac OSX 10.8 using clang/XCode 5.1

Signed-off-by: Ruben Smits <ruben.smits@intermodalics.eu>
Merge pull request #63 from orocos-toolchain/tlsf_memory_corruption_detection

Tlsf memory corruption detection