pw_allocator: replacing malloc()

Add pw_malloc module to replace libc malloc with self defined methods.

Add pw_malloc_freelist backend to provide wrapper functions for freelist
malloc.

Change-Id: I7b645206655068d6c08063d7a520aca62d955052
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12601
Commit-Queue: Chenghan Zhou <chenghanzh@google.com>
Reviewed-by: Chenghan Zhou <chenghanzh@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
diff --git a/pw_malloc_freelist/docs.rst b/pw_malloc_freelist/docs.rst
new file mode 100644
index 0000000..928ac5b
--- /dev/null
+++ b/pw_malloc_freelist/docs.rst
@@ -0,0 +1,21 @@
+.. _chapter-pw-malloc-freelist:
+
+.. default-domain:: cpp
+
+------------------
+pw_malloc_freelist
+------------------
+
+``pw_malloc_freelist`` implements the ``pw_malloc`` facade using a freelist
+heap.
+
+``pw_malloc_freelist`` initializes a global ``FreeListHeapBuffer`` object to
+organize heap usage. Implementation details are in the ``pw_allocator`` module.
+
+``pw_malloc_freelist`` provides wrapper functions for ``malloc``, ``free``,
+``realloc`` and ``calloc`` that uses the freelist implementation of heap in
+``pw_allocator``. In the GN build file, ``pw_malloc_freelist`` provides linker
+options needed in ``public_configs``, which will be forwarded to the facade. In
+the case of freelist, we specify the wrapper functions ``malloc, free, realloc,
+calloc, _malloc_r, _free_r, _realloc_r, _calloc_r`` to replace the original libc
+functions at linker time.