Forum > Other OS
Brand new iMac i5 27" retina OS10.10.6 cannot create array
summerleas:
Have I bought a useless computer?
BallotData = record
BallotNumber : longint;
NumberOfPreferences : smallint;
Preferences : array[1..256] of byte;
CurrentPreference : byte;
CurrentValue : double;
end;
var
BallotsGroup1 : array[1 .. 1000000] of BallotData;
BallotsGroup2 : array[1 .. 1000000] of BallotData;
BallotsGroup3 : array[1 .. 1000000] of BallotData;
BallotsGroup4 : array[1 .. 1000000] of BallotData;
BallotsGroup5 : array[1 .. 1000000] of BallotData;
BallotsGroup6 : array[1 .. 1000000] of BallotData;
I compiled this with:
fpc -Px86_64 -FeDesktop/Senate-preferences/SenateDebug Desktop/Senate-preferences/SenateTestExhaustedVotes.pas
The SenateDebug file reported:
Target OS: Darwin for x86_64
Compiling Desktop/Senate-preferences/SenateTestExhaustedVotes.pas
Assembling (pipe) Desktop/Senate-preferences/SenateTestExhaustedVotes.s
Linking Desktop/Senate-preferences/SenateTestExhaustedVotes
SenateTestExhaustedVotes.pas(132,49) Error: Error while linking
SenateTestExhaustedVotes.pas(132,49) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Terminal reported:
__TEXT/__text addr=0x1000015F0, size=0x00045FCE, fileOffset=0x000015F0, type=1
__TEXT/__stubs addr=0x1000475BE, size=0x0000018C, fileOffset=0x000475BE, type=28
__TEXT/__stub_helper addr=0x10004774C, size=0x00000318, fileOffset=0x0004774C, type=32
__TEXT/.fpc addr=0x100047A68, size=0x0000002A, fileOffset=0x00047A68, type=0
__TEXT/__const addr=0x100047AA0, size=0x00005513, fileOffset=0x00047AA0, type=0
__TEXT/__unwind_info addr=0x10004CFB4, size=0x00000048, fileOffset=0x0004CFB4, type=22
__DATA/__dyld addr=0x10004D000, size=0x00000038, fileOffset=0x0004D000, type=30
__DATA/__la_symbol_ptr addr=0x10004D038, size=0x00000210, fileOffset=0x0004D038, type=27
__DATA/__const addr=0x10004D250, size=0x0001158E, fileOffset=0x0004D250, type=0
__DATA/__data addr=0x10005E7E0, size=0x00005468, fileOffset=0x0005E7E0, type=0
__DATA/__common addr=0x100063C48, size=0x00001414, fileOffset=0x00000000, type=25
__DATA/__bss addr=0x100065060, size=0x00001C44, fileOffset=0x00000000, type=25
__DATA/__huge addr=0x100066CB0, size=0xBCE41084, fileOffset=0x00000000, type=25
ld: 32-bit RIP relative reference out of range (2640414934 max is +/-4GB): from _P$COUNTEXHAUSTEDBALLOTS_$$_PUTBALLOT$LONGINT$BALLOTDATA (0x100001650) to _U_$P$COUNTEXHAUSTEDBALLOTS_$$_BALLOTSGROUP6@0x9D5B3C40 (0x19D61A0B0) in '_P$COUNTEXHAUSTEDBALLOTS_$$_PUTBALLOT$LONGINT$BALLOTDATA' from Desktop/Senate-preferences/SenateTestExhaustedVotes.o for architecture x86_64
An error occurred while linking
Error: /usr/local/bin/ppcx64 returned an error exitcode
Does this mean (as I suspect) the iMac is useless because it can only access 32 bit memory blocks?
Or have I missed something?
Phil:
--- Quote from: summerleas on January 27, 2017, 01:36:43 am ---Have I bought a useless computer?
--- End quote ---
More likely useless code. Whenever I see someone using very large arrays, the "bad idea" alarm goes off in my head.
Can you explain why you can't write whatever it is you're trying to accomplish so you don't need such large arrays?
molly:
rinse and repeat
summerleas:
The data must be accessed repeatedly out of order. The alternative is to repeatedly read the data file maybe 2000 times. There is nothing wrong with large arrays per se, although I would be happy to avoid them.
Anyway, the problem appears to be with the iMac.
Phil:
--- Quote from: summerleas on January 27, 2017, 03:20:19 am ---The data must be accessed repeatedly out of order. The alternative is to repeatedly read the data file maybe 2000 times. There is nothing wrong with large arrays per se, although I would be happy to avoid them.
Anyway, the problem appears to be with the iMac.
--- End quote ---
Put the data into a file in the "out of order" order that you'll need it in.
Or put the data into a binary random-access file. Then your "array" can be as big as your disk.
Navigation
[0] Message Index
[#] Next page