I think the real problem is your use of "fixed" memory pools...
You could recompile msl with _MSL_USE_FIX_MALLOC_POOLS set to 0 and that would achieve your goal. I'm sure someone here can tell you how to do that (I don't use msl). Unfortunately, max_fix_pool_size is a constant, so I think a recompile of msl is required.
I believe the real problem is that each fixed pool uses 4k of memory... And there are *5* fixed pool sizes! You have your heap set to 4k total! So the first pool size you allocate (8 bytes) succeeds, and the second one (16 bytes) fails.
Fixed pools make no sense on a processor with 32k of total memory.
_MSL_USE_FIX_MALLOC_POOLS For tiny allocations, fixed sized pools help
significantly speed allocation/deallocation, used
only with the modern memory pooling scheme.
You can reserve a pool for a small range of
sizes. The use of fixed sized pools can be
disabled by setting
_MSL_USE_FIX_MALLOC_POOLS to 0. The
default value is 1. Use of fixed size pools
requires further configuration. The current
shipping configuration is:
1. Each pool will handle approximately 4000
bytes worth of requests before asking for more
memory.
2. There are 4 pool types. Each type is
responsible for a different range of requests:
a. 0 - 12 bytes
b. 13 - 20 bytes
c. 21 - 36 bytes
d. 37 - 68 bytes
Requests for greater than 68 bytes go to the
variable size pools. The number of types of pools
is configurable below. The range of requests for
each type is also configurable.