-
Notifications
You must be signed in to change notification settings - Fork 80
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
ftl::TaskScheduler allocator support #76
Comments
I haven't read into polymorphic_allocator or memory_resource much, but they both look much better than the default std allocators. When I was first creating this library, I was looking at EASTL, due to the pain of std allocators. With polymorphic_allocator, can this be used with std containers? Or would we need to replace the containers with something else? |
A simpler, albeit less elegant, solution would be a C-style allocation callback. |
The standard solution is to use The C++11 impl is here, provided by the guy who gave the talk that made me understand it: here (1hr). If you do want to adopt it (my preference), I would definitely recommend going the abseil strategy of just aliasing the actual type if it is available. C callback would work, wouldn't particularly make me happy tho 😄 . |
I'm working on a first attempt this weekend. |
Good stuff, aiming for the allocator method?
---
Connor Fitzgerald
Sent from my Phone. Please excuse my brevity.
…On November 17, 2018 9:40:48 AM EST, RichieSams ***@***.***> wrote:
I'm working on a first attempt this weekend.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#76 (comment)
|
Yea. I'm using his C++11 impl of pmr. I'll have to figure out the best way to switch to the c++17 one if that's available |
Take a look at Google's abseil library and how they implement std::any, std::variant, etc.
---
Connor Fitzgerald
Sent from my Phone. Please excuse my brevity.
…On November 17, 2018 11:48:29 AM EST, RichieSams ***@***.***> wrote:
Yea. I'm using his C++11 impl of pmr. I'll have to figure out the best
way to switch to the c++17 one if that's available
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#76 (comment)
|
As we start to allocate more and more with various improvements, we need a way of getting an allocator in there. My ideal would be to use
std::polymorphic_allocator<byte> + std::memory_resource
but that's c++17. Then our options are to reimplement memory_resource etc. in abseil style (there is a boost license c++11 impl of both), or to embed the allocator into the type. As a task scheduler is basically a global, embedding it in the type isn't the end of the world but would also require everything to be in the header which is less than ideal.The text was updated successfully, but these errors were encountered: