- edited description
device_allocator::allocate align parameter should be an argument
In the current spec, the byte alignment of an allocation from a device allocator is specified as a template parameter to the allocate() function. This prevents the use of runtime values for the alignment.
As far as I can tell, there isn’t any reason for this restriction either, as the alignment is then immediately passed as an argument to the segment’s allocate function.
Comments (5)
-
reporter -
@Amir Kamil do you recall why we went with a defaulted template parameter here instead of a defaulted function argument? I think the latter provides all the same benefits as the former, but additionally allows runtime values.
As Max says, the implementation side for a defaulted function argument looks trivial.
-
I don’t recall ever discussing this, but it looks like it came from the strawman you proposed in
#30. -
Signature changes specced in pull request #25 and implemented in Impl PR 122
-
- changed status to resolved
Change alignment to be a function parameter in allocate<T>(). Fixes
#145.→ <<cset 33a113f90be5>>
- Log in to comment