diff options
author | Ruchir Rastogi <ruchirr@google.com> | 2019-11-07 14:10:32 -0800 |
---|---|---|
committer | Ruchir Rastogi <ruchirr@google.com> | 2019-12-18 13:17:36 -0800 |
commit | a38d5a6fd66226f7073919dd5abe35d154ba823d (patch) | |
tree | fddaf491f2a58f3b6e3d6ba2c100f03d134f14c9 /libutils/ProcessCallStack_fuzz.cpp | |
parent | 3822e61d7b77ed80aae8169d7146f8c244a12cae (diff) |
Simplified stats_event.c; exposed getter methods
Simplifications/changes:
(1) We remove the bufPos field and track the end of the buffer using
only the size field.
(2) We rename put_<type>() functions to append_<type>() to signify that the
value will be placed at the end of the buffer. We also move the
increment of event->size to within the append_<type>() functions;
this improves readability of the write_<type>() functions.
(3) We immediately write the timestamp and atom id to the buffer in
order to simplify stats_event_build().
(4) We never check for null pointers; checking for null pointers
delays errors and obfuscates the root problem.
(5) We change the the annotationId and numPairs parameters to be
uint8_t's. This helps signify to clients that these values must fit
in 1 byte.
(6) Clients no longer have to pass in the length of strings. Instead, we
expect them to pass in null-terminated strings, and we will
calculate the length outselves using strnlen.
Test: m -j libstatssocket
Change-Id: I6d192768876a23d7016173bcdaf59f8b7e92b182
Merged-In: I0173f8bc76ef25118379dce5d2481f5f7a9b7519
Diffstat (limited to 'libutils/ProcessCallStack_fuzz.cpp')
0 files changed, 0 insertions, 0 deletions