lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Well, I went the whole hog and upgraded to Lua 5.0 and then shifted the
64-bit numbers in the code to 32. FYI, 5.0 worked without any real
modifications (the garbage collection bug I described before did not
reappear straight away - although I did not conclusively test. The 64->32
bit transition wasn't as simple as it could possibly be - there are still
several occurences of long and unsigned long in the code-base. Might I
suggest a typedef so that is localised to a single place? Several of the
occurrences mentioned '32-bit or more', suggesting that a single set of
typedefs for INT32, UINT32, etc. might be appropriate (obviously with the
names munged to avoid conflicts with the Win32 typedefs with the same name).

The only occurrence of double was in the L_Umaxalign definition, which I
changed to be:
	typedef union { float u; void *s; int l; } L_Umaxalign;
instead of
	typedef union { double u; void *s; long l; } L_Umaxalign;

After that, all seems peachy. There appears to be some different behaviour
related to lua_ref, but it may just be reporting dodgy scripts that
previously slipped under the radar.

Only reply on the PS2 dev newsgroups is currently - 'swap all 64 bit types
to 32 bit', which although it solves the problem, doesn't really address the
compiler issue. I will post again if there is anything more explicit to fix
the compilation under GNU.

-----Original Message-----
From: Nick Trout []
Sent: 06 October 2003 18:55
To: Lua list
Subject: RE: Lua on the PlayStation2

> From: Chris Chapman 
> Sent: Monday, October 06, 2003 6:08 AM
> To: 'Lua list'
> Subject: RE: Lua on the PlayStation2
> Sorry, I thought immediately after I sent it that I should have stated
> version. We are using lua-4.0.1 which has double in a few places. On
> browsing over the 5.0 code it seems they have been fixed. :)
> We are hoping to upgrade to 5.0 as soon as possible, but when I tried
> last time there was an obscure crash and I couldn't easily track it in
> limited time available. Would I be right to hazard a guess that 5.0 is
> bit
> more PS2 friendly that 4.0.1 then? If so I will prioritise upgrading
> tracking this obscure GC/64-bit operation bug.

You should probably remove all traces of 64 bit-ness on PS2. This will
save memory and possibly make it run faster. In Lua 5.0 I think you just
need to define LUA_NUMBER as float in your compiler environment, as you
know PS2 doesn't do hardware doubles. long is 64 bit on PS2 so change
all instances of this to int. Go into llimits.h and change all