Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZookeeperInstance should not rely on raw pointers for cache and keeper pointers #63

Open
phrocker opened this issue May 12, 2020 · 0 comments

Comments

@phrocker
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant