Skip to content

Rename SharedMemoryHashSet to BlockMemoryHashSet#3150

Merged
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
ambuc:rename-sharedmemoryhashset-to-blockmemoryhashset
Apr 20, 2018
Merged

Rename SharedMemoryHashSet to BlockMemoryHashSet#3150
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
ambuc:rename-sharedmemoryhashset-to-blockmemoryhashset

Conversation

@ambuc
Copy link
Copy Markdown
Contributor

@ambuc ambuc commented Apr 20, 2018

Signed-off-by: James Buckland jbuckland@google.com

Title: Rename SharedMemoryHashSet to BlockMemoryHashSet

Description: The class currently named SharedMemoryHashSet has no specific bias towards shared or non-shared memory, instead accepts a pointer to the buffer in memory for the set data.

For context, a solution for #2453 could use this hash set to implement reference counting across scopes. It would not necessarily need to run in shared memory.

Risk Level: Low

Testing: N/A - no behavior change.

Docs Changes: N/A, this is not user-facing.

Release Notes: N/A

Signed-off-by: James Buckland <jbuckland@google.com>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me. Small comment/nit.


/**
* Initialization parameters for SharedMemoryHashSet. The options are duplicated
* Initialization parameters for BlockMemoryHashSet. The options are duplicated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you search this file for "shared" as well as the cc file? I think there are some comments that need to be fixed in a similar way...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think I caught them in c03b486.

Signed-off-by: James Buckland <jbuckland@google.com>

int flags = O_RDWR;
const std::string shmem_name = fmt::format("/envoy_shared_memory_{}", options.baseId());
const std::string shmem_name = fmt::format("/envoy_block_memory_{}", options.baseId());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one should be reverted. a) it is shared memory. b) it's possible people have setup permissions to allow this exact path. I see no reason to change it...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I'll swap this back.

Signed-off-by: James Buckland <jbuckland@google.com>
@mattklein123 mattklein123 merged commit e0332af into envoyproxy:master Apr 20, 2018
@ambuc ambuc deleted the rename-sharedmemoryhashset-to-blockmemoryhashset branch April 21, 2018 18:56
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

Successfully merging this pull request may close these issues.

2 participants