Encode flatbuffers directly into the encoder when logging

We were running out of memory when running for many hours.  Initial
debugging looked like it was a heap fragmentation issue.  Tracking the
allocated memory using the malloc hooks wasn't showing any growth of
memory.  The heap was growing though.

Instead of allocating a FlatBufferBuilder/DetachedBuffer for each
message to be logged, we can instead have the BufferEncoder provide
memory to write to, and have it only alloate that buffer space once, and
allocate it to the maximum size that a writer might see.

Change-Id: I046bd2422aea368867b0c63cee7d04c6033fe724
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/starter/starter_demo.py b/aos/starter/starter_demo.py
index f8fa520..5a50890 100755
--- a/aos/starter/starter_demo.py
+++ b/aos/starter/starter_demo.py
@@ -24,6 +24,8 @@
     parser.add_argument("ping", help="Location of ping")
     parser.add_argument("pong", help="Location of pong")
     parser.add_argument("starter_cmd", help="Location of starter_cmd")
+    parser.add_argument("aos_dump", help="Location of aos_dump")
+    parser.add_argument("logger_main", help="Location of logger_main")
     args = parser.parse_args()
 
     # Copy all the interesting files into a temporary directory and run
@@ -38,6 +40,8 @@
         shutil.copy(args.ping, tmpdir + "/ping")
         shutil.copy(args.pong, tmpdir + "/pong")
         shutil.copy(args.starter_cmd, tmpdir + "/starter_cmd")
+        shutil.copy(args.aos_dump, tmpdir + "/aos_dump")
+        shutil.copy(args.logger_main, tmpdir + "/logger_main")
         print(f"Running starter from {tmpdir}")
 
         print(f"\n\nTo run starter_cmd, do:\ncd {tmpdir}\n./starter_cmd\n\n")