Skip to content

Conversation

@ab9rf
Copy link
Member

@ab9rf ab9rf commented Oct 23, 2025

current code has three different allocator functions, the generic one, one labeled nodel and one labeled noassign

the noassign allocator just mimics the behavior of the basic one when the type in question is not copy-assignable, and is only being used for types that may not be copy-assignable, and so in those cases the default allocator will work exactly the same anyway, and so noassign is wholly redundant. iirc noassign was introduced to deal with types that aren't copy-assignable, but the logic in the regular allocator handles that anyway

meanwhile, the nodel version is entirely unused, and i can't find any history of what it was ever intended to be used for

thus, this PR removes the nodel and noassign versions (nodel for being unused, and noassign for being redundant), and folds try_assign into the allocator so that all the logic is in one place

also add in-code documentation

current code has three different allocator functions, the generic one, one labeled "nodel" and one labeled "noassign"

the `noassign` allocator just mimics the behavior of the basic one when the type in question is not copy-assignable and is only being used for types that are not copy-assignable so the default allocator will work _exactly_ the same anyway

the `nodel` version is entirely unused

thus, this PR removes the `nodel` and `noassign` versions and folds `try_assign` into the allocator so that all the logic is in one place

also add in-code documentation
@ab9rf ab9rf merged commit 865d07c into DFHack:develop Oct 23, 2025
14 checks passed
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.

1 participant