pointcache: add PointCache utility class

This is a simple cache that keeps x,y pairs for use when drawing
visualizers. To keep this generic, and save on memory, we simply
store the x,y coordinates as floats between 0.0 and 1.0. This
saves us roughly 50% on each data point over the 2 8-byte
numbers we would otherwise store.

Obviously, we could take this further and make some fancy index
storage with run-length-encode values, but this should work for
now and allow us to get more exotic later.
This commit is contained in:
Christian Hergert
2016-09-26 17:34:58 -07:00
parent 0a9193ab70
commit 571c2320da
3 changed files with 158 additions and 0 deletions

View File

@ -18,6 +18,8 @@ libutil_la_SOURCES = \
util/demangle.h \
util/elfparser.c \
util/elfparser.h \
util/pointcache.c \
util/pointcache.h \
util/stackstash.c \
util/stackstash.h \
$(NULL)