Repository navigation
Conversation
keremsahn
force-pushed
the
on-demand-analyzer
branch
from
October 28, 2026 09:25
437c8fc to
59c45fe
Compare
keremsahn
force-pushed
the
on-demand-analyzer
branch
from
November 23, 2026 14:20
59c45fe to
feb3edf
Compare
ll_dealloc freed fBuf, the address of the pointer slot, so every owning view leaked its buffer. It now frees get_buf(), and the new kIsNew flag, exposed as __is_new__, separates new, new[] and malloc. HandleReturn takes ownership of a returned view and writes the allocation kind. The release loop clears the ownership of a view argument that the callee frees.
keremsahn
force-pushed
the
on-demand-analyzer
branch
from
November 23, 2026 14:21
feb3edf to
3ecefce
Compare
The attribute checkers give no answer for a function that carries no ownership attribute. In that case cppjit can read the function body instead. The analyzer only guesses, so it stays off until use_memory_analyzer(True) turns it on. An attribute always wins over the analyzer, per parameter on the deallocation side.
keremsahn
force-pushed
the
on-demand-analyzer
branch
from
November 23, 2026 14:46
3ecefce to
36a55c2
Compare
Contributor
Author
@@ Benchmark Diff (geomean) @@
## main analyzer +/- ##
============================================================
first/callback 616.4 M 617.6 M +0.20%
first/class 9.581 M 9.597 M +0.16%
first/overload 9.606 M 9.615 M +0.10%
first/primitive 8.745 M 8.75 M +0.06%
first/string 10.08 M 10.08 M +0.01%
first/template 11.26 M 11.28 M +0.14%
first/template_overload 13.93 M 13.95 M +0.15%
hot/callback 8.516 k 8.627 k +1.30%
hot/class 3.129 k 3.207 k +2.48%
hot/overload 2.909 k 3.017 k +3.73%
hot/primitive 2.289 k 2.334 k +1.98%
hot/string 8.891 k 8.903 k +0.13%
hot/template 4.565 k 4.635 k +1.54%
hot/template_overload 3.01 k 3.092 k +2.73%
============================================================
- Slower 3
+ Faster 0
Unchanged 219Benchmarks against main, for all tests analyzers are enabled. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Built upon #158, just third commit is relevant
cppjit now reads a function body when no ownership attribute answers for that function. The analyzer only guesses, so it stays off by default and
cppjit.use_memory_analyzer(True)turns it on.Cpp::GetAllocTypeandCpp::GetDeallocTypeasinterop::GetAllocTypeandinterop::GetDeallocType.UseMemoryAnalyzerentry point and thecppjit.use_memory_analyzer()wrapper. One flag drives both analyzers, and it is off by default.GetAllocBehaviourwhen the attribute checker reportsUnknown.FillDeallocBehaviour. An attribute wins, and the analyzer answer moves by one slot for a method@Vipul-Cariappa