1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-07 19:10:25 +00:00

Minor change to mem structure

Change to mem.TYPE from LONG variable type to OFFSET.  This prevents
4-bytes padding from throwing off values for mem.ELEMENTSIZE and
mem.IMAGE on 64-bit systems.

Patch should work on Mac, Linux, and Windows; both 32-bit and 64-bit
versions, giving the correct results for mem.ELEMENTSIZE and mem.IMAGE
from now on.
This commit is contained in:
SteveMcNeill 2017-08-02 01:00:01 -04:00
parent f289da3a5a
commit 78d4b607bd
3 changed files with 11947 additions and 11947 deletions

View file

@ -453,7 +453,7 @@ struct mem_block{
ptrszint size;
int64 lock_id;//64-bit key, must be present at lock's offset or memory region is invalid
ptrszint lock_offset;//pointer to lock
int32 type;
ptrszint type;
/*
memorytype (4 bytes, but only the first used, for flags):
1 integer values

View file

@ -4,4 +4,4 @@ DIM SHARED AutoBuildMsg AS STRING
Version$ = "1.1"
'BuildNum format is YYYYMMDD/id, where id is a ever-increasing
'integer. If you make a change, update the date and increase the id!
BuildNum$ = "20170721/56"
BuildNum$ = "20170802/57"

View file

@ -1565,7 +1565,7 @@ IF Cloud = 0 THEN
lasttype = lasttype + 1: i = lasttype
udtxname(i) = "_MEM"
udtxcname(i) = "_MEM"
udtxsize(i) = ((ptrsz) * 4 + (4) * 2 + (8) * 1) * 8
udtxsize(i) = ((ptrsz) * 5 + (4) * 1 + (8) * 1) * 8
udtxbytealign(i) = 1
lasttypeelement = lasttypeelement + 1: i2 = lasttypeelement
udtename(i2) = "OFFSET"
@ -1603,7 +1603,7 @@ IF Cloud = 0 THEN
udtename(i2) = "TYPE"
udtecname(i2) = "TYPE"
udtebytealign(i2) = 1
udtetype(i2) = LONGTYPE: udtesize(i2) = 32
udtetype(i2) = OFFSETTYPE: udtesize(i2) = ptrsz * 8
udtetypesize(i2) = 0 'tsize
udtenext(i3) = i2
i3 = i2