-
Notifications
You must be signed in to change notification settings - Fork 4
Description
A) ZookeeperInstance contains two raw pointers. These can be moved over to unique_ptr.
B) The watch contained within used pthread_mutex_t. This isn't transportable, so we should likely move this to std::mutex, while also making sure the class is const correct. [2]
C) ZooCache and getData return uint8_t* pointers. We should verify that the data that's inserted into the cache map is reclaimed. [3,4] In [4] we create a buffer of 1024. out of zoo_wget. We should have a non-created heap buffer ( perhaps we could use std::string. Per [5] we have guaranteed buffer to be contiguous. While still on the heap it's not managed by us and reduced the number of copies needed ).
[1] https://github.com/phrocker/sharkbite/blob/master/include/data/constructs/client/zookeeperinstance.h
[2] https://github.com/phrocker/sharkbite/blob/master/include/data/constructs/client/zookeeper/watch.h
[3] https://github.com/phrocker/sharkbite/blob/master/include/data/constructs/client/zookeeper/zoocache.h
[4]https://github.com/phrocker/sharkbite/blob/master/include/data/constructs/client/zookeeper/zookeepers.h
[5] https://stackoverflow.com/questions/1986966/does-s0-point-to-contiguous-characters-in-a-stdstring