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

Allocate #2460

Merged
merged 4 commits into from
Dec 28, 2024
Merged

Allocate #2460

merged 4 commits into from
Dec 28, 2024

Conversation

brucemiller
Copy link
Owner

This PR makes register allocation (eg \newcount and friends) a bit safer against load order or accidental redefinitions. A new utility \lx@alloc@ useful for plain's \alloc@ and LaTeX's \e@alloc avoids allocating a \count (etc) slot if it has already been assigned to a register. NewCounter(...) avoids redefining counters.

…sed; NewCounter avoids redefining a counter that already was defined; uses internal arabic macro for \the<ctr>
@brucemiller brucemiller requested a review from dginev December 28, 2024 15:42
Copy link
Collaborator

@dginev dginev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks healthy, as far as I can tell :> Thanks!

else {
my $xnext = $STATE->lookupValue($tracker) || Number(0);
$next = $xnext->valueOf + 1; }
my $value = Number($next);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$value is never used?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! removed; thanks!

@brucemiller brucemiller merged commit 74c0e05 into master Dec 28, 2024
26 checks passed
@brucemiller brucemiller deleted the allocate branch December 28, 2024 21:40
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.

2 participants