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

An typo in CacheLib docs #71

Closed
skyelves opened this issue Nov 1, 2021 · 2 comments
Closed

An typo in CacheLib docs #71

skyelves opened this issue Nov 1, 2021 · 2 comments

Comments

@skyelves
Copy link

skyelves commented Nov 1, 2021

There is an typo in https://cachelib.org/docs/Cache_Library_User_Guides/Write_data_to_cache#write-data-to-allocated-memory-and-insert-item-handle-into-cache.

string data("new data");
// Allocate memory for the data.
auto item_handle = cache->allocate(pool_id, "key2", data.size());

// Write the data to the cache.
std::memcpy(handle->getMemory(), data.data(), data.size());

There is no handle but item_handle. Therefore, std::memcpy(handle->getMemory(), data.data(), data.size()); should be changed to std::memcpy(item_handle->getMemory(), data.data(), data.size());

@haowu14
Copy link
Contributor

haowu14 commented Nov 1, 2021

Thank you for pointing out! Fix is on the way.

facebook-github-bot pushed a commit that referenced this issue Nov 1, 2021
Summary: Fixing a typo pointed out by #71

Reviewed By: agordon

Differential Revision: D32075133

fbshipit-source-id: af1fe95f5625df544c13dbd3d2d991079783ec67
@skyelves skyelves closed this as completed Nov 2, 2021
@haowu14
Copy link
Contributor

haowu14 commented Nov 3, 2021

Finally redeployed webpage.

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

No branches or pull requests

2 participants