This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: short pointers (32 bit) in 64 bit apps


On 19/05/2010 3:58 p.m., Reza Roboubi wrote:
Do you know what it takes to do it? How much work for a newcomer to get
up to speed with gcc? (Maybe this should go to the developer list?)

You would need to write a memory allocator which divides the address space into 4GB (32-bit pages). Then you could create a new malloc routine which has an extra argument to allow you to allocate memory from within a specified 4GB page. That way you can make all of your allocations for a given data structure lie within the same region.


Then you can add the top 32-bits to pointer addresses within your data structure before you attempt to dereference them.

Cheers,
Nicholas Sherlock


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]