-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
gh-142183: Change data stack to use a resizable array #148681
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
Open
dpdani
wants to merge
11
commits into
python:main
Choose a base branch
from
dpdani:gh-142183-stack-resizable-array
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cfaca85
gh-142183: Change data stack to use a resizable array
dpdani bb08739
📜🤖 Added by blurb_it.
blurb-it[bot] 99bb502
skip tests failing on emscripten
dpdani daa182a
Merge branch 'main' into gh-142183-stack-resizable-array
dpdani 99e9e44
Fix regression in profiler module
pablogsal bab3d69
improve docs
dpdani 772a834
regen-all
dpdani 67e89ce
Merge branch 'main' into gh-142183-stack-resizable-array
dpdani 970282d
Merge branch 'main' into gh-142183-stack-resizable-array
dpdani 5f98e7e
regen-all
dpdani 73e1457
regen-all
dpdani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| digraph stack_resize { | ||
| graph [ | ||
| fontname="Monaco", | ||
| fontsize=16, | ||
| bgcolor="white", | ||
| compound=true, | ||
| newrank=true, | ||
| splines=false | ||
| ]; | ||
|
|
||
| node [ | ||
| fontname="Monaco", | ||
| fontsize=16, | ||
| shape=box, | ||
| style="rounded,filled", | ||
| color="#2563eb", | ||
| fillcolor="white", | ||
| penwidth=2, | ||
| fixedsize=true | ||
| ]; | ||
|
|
||
| edge [ | ||
| color="#111111", | ||
| fontname="Monaco", | ||
| penwidth=2, | ||
| arrowsize=0.75 | ||
| ]; | ||
|
|
||
| subgraph cluster_older_chunk { | ||
| label="older chunk"; | ||
| labelloc=b; | ||
| fontcolor="#0f172a"; | ||
| style="rounded,filled"; | ||
| color="#334155"; | ||
| fillcolor="#f1f5f9"; | ||
| penwidth=2; | ||
| margin=24; | ||
|
|
||
| node [ | ||
| color="#64748b", | ||
| width=2.5, | ||
| ]; | ||
|
|
||
| old_frame_hidden [style="invis", label=""]; | ||
| old_frame_1 [style="invis", label=""]; | ||
| subgraph cluster_older_frames { | ||
| label=""; | ||
| penwidth=0; | ||
| old_frame_2 [label="older frame"]; | ||
| old_frame_3 [label="older frame"]; | ||
| } | ||
| old_previous [ | ||
| color="invis", | ||
| fillcolor="invis", | ||
| width=2.15, | ||
| height=0.58, | ||
| label="previous = NULL" | ||
| ]; | ||
|
|
||
| old_frame_hidden:s -> old_frame_1:n [style="invis"]; | ||
| old_frame_1:s -> old_frame_2:n [style="invis"]; | ||
| old_frame_2:s -> old_frame_3:n; | ||
| old_frame_3:s -> old_previous:n [style="invis"]; | ||
| } | ||
|
|
||
| subgraph cluster_newest_chunk { | ||
| label="newest chunk"; | ||
| labelloc=b; | ||
| fontcolor="#0f172a"; | ||
| style="rounded,filled"; | ||
| color="#1e3a8a"; | ||
| fillcolor="#eaf4ff"; | ||
| penwidth=2; | ||
| margin=24; | ||
|
|
||
| newer_frame_hidden [width=2.5, style="invis"]; | ||
| top_frame [width=2.5, label="top frame", style="invis"]; | ||
| newer_frame_1 [width=2.5, label="newer frame", style="invis"]; | ||
| newer_frame_2 [width=2.5, label="top frame"]; | ||
|
|
||
| subgraph cluster_untouched_memory { | ||
| label=""; | ||
| color="#f59e0b"; | ||
| fillcolor="#ffec99"; | ||
| style="filled,dashed"; | ||
| penwidth=2; | ||
| margin=24; | ||
|
|
||
| node [ | ||
| width=2.5, | ||
| height=0.5, | ||
| ]; | ||
|
|
||
| untouched_memory_top [style="invis", label=""]; | ||
| untouched_memory_bottom [style="invis", label=""]; | ||
| } | ||
|
|
||
| new_previous [ | ||
| color="invis", | ||
| fillcolor="invis", | ||
| width=1.15, | ||
| height=0.58, | ||
| label="previous" | ||
| ]; | ||
|
|
||
| newer_frame_hidden:s -> top_frame:n [style="invis"]; | ||
| top_frame:s -> newer_frame_1:n [style="invis"]; | ||
| newer_frame_1:s -> newer_frame_2:n [style="invis"]; | ||
| newer_frame_2:s -> untouched_memory_top:n [ | ||
| lhead=cluster_untouched_memory, | ||
| style="invis", | ||
| ]; | ||
| untouched_memory_bottom:s -> new_previous:n [ | ||
| ltail=cluster_untouched_memory, | ||
| style="invis", | ||
| ]; | ||
| } | ||
|
|
||
| stack_top_label [ | ||
| shape=plaintext, | ||
| style="", | ||
| fixedsize=false, | ||
| label="stack_top", | ||
| fontcolor="#0f172a" | ||
| ]; | ||
|
|
||
| { rank=same; old_frame_1; newer_frame_2; } | ||
| { rank=same; old_frame_2; untouched_memory_top; } | ||
| { rank=same; old_frame_3; untouched_memory_bottom; } | ||
| { rank=same; old_previous; new_previous; } | ||
| { rank=same; newer_frame_2; stack_top_label; } | ||
|
|
||
| newer_frame_2 -> stack_top_label [style=invis, weight=100, constraint=false]; | ||
| old_frame_1 -> newer_frame_2 [style=invis, weight=100, constraint=false]; | ||
|
|
||
| newer_frame_2:w -> old_frame_2:e [ | ||
| constraint=false, | ||
| ]; | ||
| stack_top_label:w -> newer_frame_2:e [ | ||
| constraint=false | ||
| ]; | ||
| new_previous:w -> old_previous:e [ | ||
| lhead=cluster_older_chunk, | ||
| constraint=false | ||
| ]; | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I have learned while working on this PR, those kinds of pointer comparisons are undefined behaviour according to the C standard, because they do not belong to the same object. See Section 6.5.8, paragraph 5 (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf).
So
ptr >= startis undefined, but computing where the pointer would have been in the new allocation and checking for equality is ok.