Re: Porting to 64-bit platforms

  • From: Emil Dotchevski <emil@xxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 19 Aug 2013 11:18:51 -0700

Is it at all plausible to support platforms where the 64-bit address
space doesn't have all zeroes in the high-order 32-bit part by
changing LJ so that whenever it reads an address from a TValue, its
high-order part is set to a OS-specific constant value?

Thanks,
Emil

On Sat, Aug 17, 2013 at 7:30 AM, Mike Pall <mike-1308@xxxxxxxxxx> wrote:
> Emil Dotchevski wrote:
>> I see that LJ uses NtAllocateVirtualMemory to get memory, with the
>> flag NTAVM_ZEROBITS. That flag isn't supported on the new XBOX, though
>> the function is available.
>
> An alternative would be probing memory in the lowest 2G, like some
> other platforms do. I guess this could be implemented with plain
> VirtualAlloc plus maybe VirtualQuery if sequential/random probing
> fails too often.
>
> Changing the TValue representation is a no-go, as that would
> necessitate a rewrite of the whole VM.
>
> --Mike
>

Other related posts: