Commit 84fd57c
committed
Fix missing alignment in calloc() and realloc()
The calloc() and realloc() implementations did not align the requested
size before passing it to the allocator. This could result in returning
non-aligned memory blocks, which may trigger unaligned memory access
exceptions on RISC-V.
Align the total size in calloc() and the input size in realloc() to
ensure the allocator always returns properly aligned memory.1 parent 877f973 commit 84fd57c
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
| |||
0 commit comments