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

Questions #2

Open
DenisYaroshevskiy opened this issue Jul 18, 2019 · 2 comments
Open

Questions #2

DenisYaroshevskiy opened this issue Jul 18, 2019 · 2 comments

Comments

@DenisYaroshevskiy
Copy link

DenisYaroshevskiy commented Jul 18, 2019

Hi

This align confused me:

auto align(char* buf_start) -> char* {

I thought that when you do placement new, you should automatically get the aligned address.
And also that aligned_storage should have sufficient size to store anything of that size or less.

Is this to support custom aligned types and arbitrary buffer sizes?
What are you trying to achieve?

Why do you use RTTI instead of strategy pattern?

return x && y && (std::type_index(typeid(*x)) == std::type_index(typeid(*y)));

@DenisYaroshevskiy DenisYaroshevskiy changed the title Question about small buffer Questions Jul 18, 2019
@atomgalaxy
Copy link
Owner

atomgalaxy commented Jul 18, 2019 via email

@DenisYaroshevskiy
Copy link
Author

Remembered about this old post by Sean Parent on the subject: http://stlab.cc/tips/small-object-optimizations.html

It's a tricky exercise in general.

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