
#8199: Get rid of HEAP_ALLOCED
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner: ezyang
Type: feature | Status: new
request | Milestone: 7.10.1
Priority: normal | Version: 7.7
Component: Compiler | Keywords:
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Project (more
Unknown/Multiple | than a week)
Type of failure: | Blocked By: 5435
None/Unknown | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: D207 |
-------------------------------------+-------------------------------------
Comment (by ajp):
Method 1 from the attached task may actually be made to work (at least on
Linux). The key point is that we don't have to use the memory address that
we happened to be given at startup. We can shift it to an aligned location
using MREMAP, and simply include a mb of padding at the end to avoid
trashing anything. Here's a modification of the code in the attached task
that demostrates shifting the memory address with zero copies.
{{{
┌─[anders gurney] [~/devel/alignment]
└─[139] cat test.S
.section foo,"aw"
.p2align 20
.global foo_start
.global foo_end
foo_start:
.ascii "A"
.fill 1048576
foo_end:
.ascii "B"
┌─[anders gurney] [~/devel/alignment]
└─[0] cat main.c
#define _GNU_SOURCE
#include