(1) Remove malloc in poolAllocator. In shared library, the malloc can only be replaced by another version of malloc in LDSYM. It will make poolAllocator cannot use malloc to initialize a memory pool.
(2) Add kvsMalloc and __wrap_kvsMalloc. It can be switched by wrapping it in link time in static build.
(3) Add __wrap_malloc in samples so that it can replace malloc in link time in static build.
(4) Add malloc implementation in samples so that it replace malloc in runtime in shared build.
(5) Refactor libraries CMake files. There will be interface build, shared build, and static build for all 3rd party libraries. For KVS library, it supports only static build, but it support static and shared dependencies. All linux samples support using shared libraries and using static libraries.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
(1) Remove malloc in poolAllocator. In shared library, the malloc can only be replaced by another version of malloc in LDSYM. It will make poolAllocator cannot use malloc to initialize a memory pool.
(2) Add kvsMalloc and __wrap_kvsMalloc. It can be switched by wrapping it in link time in static build.
(3) Add __wrap_malloc in samples so that it can replace malloc in link time in static build.
(4) Add malloc implementation in samples so that it replace malloc in runtime in shared build.
(5) Refactor libraries CMake files. There will be interface build, shared build, and static build for all 3rd party libraries. For KVS library, it supports only static build, but it support static and shared dependencies. All linux samples support using shared libraries and using static libraries.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.