260d80f42d Update ns_nvm_helper license text and format (#98)
git-subtree-dir: features/frameworks/nanostack-libservice
git-subtree-split: 260d80f42da24fa41656222294abc38f7779bdcf
If same allocator (alloc call) allocates multiple dynamic memory blocks,
the additional blocks are added to extended memory block list, and
the allocator list reference count and total sizes are increased.
When statistics are calculated, it is only needed to process the
allocator list, not the whole memory block list.
Added also optional hash function to calculate the (start) index where
memory block information is stored on extended memory block list. Hash
is calculated from memory block address.
It is expected that hash distributes the free index searches evenly
to whole memory area allocated for extended memory block list. So if
area is large enough, in most cases the index pointed by the hash, or
the index few indexes from that, should be empty and available for use.
Similarly, when memory block is freed, the search for the block on
the extended memory block list, starts from the index pointed by the
hash.
If hash is not used, extended memory block list searches start always
from index 0.
Nanostack dynamic memory tracker tracks memory allocations. It has following
interface:
ns_dyn_mem_tracker_lib_alloc: is called on alloc
ns_dyn_mem_tracker_lib_free: is called on free
ns_dyn_mem_tracker_lib_step: updates the lifetime of individual memory
blocks (is used to detected which blocks are permanent and which
have been allocated lately)
ns_dyn_mem_tracker_lib_allocator_lists_update: updates allocator lists,
there are lists for top allocators, permanent allocators and allocators
going to permanent allocators list
ns_dyn_mem_tracker_lib_max_snap_shot_update: can be used to update memory
maximum usage snap shot, this can be called on alloc if snap shot is
needed
Nanostack related files moved under 'feature/nanostack'
Common libraries moved to 'features/frameworks'
Allow FEATURE_COMMON_PAL still to be defined in the build so
that we don't break any builds.