Skip to content

Commit e333199

Browse files
committed
Support other forms of quote node in allocated macro function elision
Refs #58057
1 parent ccef01a commit e333199

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

base/timing.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ function is_simply_call(@nospecialize ex)
495495
for a in ex.args
496496
a isa QuoteNode && continue
497497
a isa Symbol && continue
498-
Base.is_self_quoting(a) && continue
498+
is_self_quoting(a) && continue
499+
is_quoted(a) && continue
499500
return false
500501
end
501502
return true
@@ -516,6 +517,7 @@ julia> @allocated rand(10^6)
516517
```
517518
"""
518519
macro allocated(ex)
520+
ex = macroexpand(__module__, ex)
519521
if !is_simply_call(ex)
520522
ex = :((() -> $ex)())
521523
end
@@ -541,6 +543,7 @@ julia> @allocations rand(10^6)
541543
This macro was added in Julia 1.9.
542544
"""
543545
macro allocations(ex)
546+
ex = macroexpand(__module__, ex)
544547
if !is_simply_call(ex)
545548
ex = :((() -> $ex)())
546549
end

0 commit comments

Comments
 (0)