Commit abc78da
committed
fix(math/strided/special/dfloor): replace stack allocation with dynamic allocation in benchmark
Replace fixed-size array declarations with dynamic memory allocation in
the dfloor benchmark to prevent segmentation faults when processing
large input sizes. The benchmark previously failed with segmentation
faults for arrays with 1,000,000 elements due to stack memory limitations.
Changes:
- Replace stack-allocated arrays with malloc/free for x and y arrays
- Add proper error handling for memory allocation failures
- Add memory cleanup to prevent memory leaks
- Add error checking in main benchmark loop
Fixes: #7224
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: missing_dependencies
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: na
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---1 parent 398ac1c commit abc78da
File tree
1 file changed
+22
-2
lines changed- lib/node_modules/@stdlib/math/strided/special/dfloor/benchmark/c
1 file changed
+22
-2
lines changedLines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
122 | 135 | | |
123 | 136 | | |
124 | 137 | | |
| |||
136 | 149 | | |
137 | 150 | | |
138 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
139 | 155 | | |
140 | 156 | | |
141 | 157 | | |
| |||
162 | 178 | | |
163 | 179 | | |
164 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
165 | 185 | | |
166 | 186 | | |
167 | 187 | | |
| |||
0 commit comments