Skip to content

LUA16 cannot handle tables > 64K #7

@PeterFidelman

Description

@PeterFidelman

Problem:

LUA16.EXE is compiled with -wl which specifies the large memory model, meaning pointer offsets will wrap around at 64KB. Trying to grow data structures, such as tables, to larger than 64KB will cause memory corruption.

Reproduction in LUA16.EXE,

arr = {}
for i = 1, 10000 do arr[i] = i end

This hangs LUA16.EXE, but works just fine in LUA4G.EXE and presumably in the other 32-bit builds as well.

If this is intended behavior it should be documented. Ideally, LUA16.EXE would be built for the huge memory model so data structures wouldn't have a 64KB size limit. I've tried doing this myself but ran into segment size issues; I'll post an update here if I get it working. Reporting it here so maybe someone else can get it working before I do.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions