Closed quininer closed 3 years ago
I think if the goal here is solely to reduce code size due to PL, than the problem should be either solved upstream, or worked-around downstream. Placing a workaround into an intermediate library isnt’ worth it, imo :P
Curious, would slappping inline(never)
onto initialize
help?
We might also want to ditch pl mutexes altogether, and use the underlying parking mechanism directly. That should also reduce the size of cell itself, I think. I’d be willing to accept/write a patch for that, but it should be written in a very clean style, such that it’s easy to see that it is correct.
The parking_lot cannot determine whether this is a cold path, so putting this method upstream is not appropriate.
Curious, would slappping inline(never) onto initialize help?
This won't help, because initialize is a generic method.
This won't help, because initialize is a generic method.
Ag, that is a bug I think! Take a look at the std impl for the trick to un-generalize it.
I added initialize_inner
according to imp_std
.
bors r+
Thanks!
I have observed that the program size has increased a lot after enabling the
parking_lot
feature.parking_lot
will actively inline methods, which leads to some unnecessary duplication of code. see https://github.com/Amanieu/parking_lot/pull/236This PR introduces an
InlineLessRawMutex
wrapper to avoid this problem.initialize
is a cold path, I don't think this will cause performance problems.