Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: urgent question to ´MS-VC++ 6.0´ experts (Dann Corbit?)

Author: Steve Coladonato

Date: 10:27:59 12/05/03

Go up one level in this thread


On December 05, 2003 at 10:15:13, martin fierz wrote:

>On December 05, 2003 at 08:55:49, Steve Coladonato wrote:
>
>>On December 05, 2003 at 08:45:56, martin fierz wrote:
>>
>>>On December 05, 2003 at 07:37:15, F. Huber wrote:
>>>
>>>>Hi,
>>>>
>>>>a few days ago i discovered a big problem with my compiled version of
>>>>Chest (´WinChest.exe´), which occurs since the very first release:
>>>>(I didn´t realize it earlier, because until now i had only a notebook
>>>>with 128MB RAM, and now have changed to a desktop P4-2.66 with 512MB)
>>>>
>>>>WinChest is requesting its hash memory from Windows by calloc(), but
>>>>whenever the needed memory is larger than 256MB, this function call
>>>>is not successful - it gets no more mem from Windows than this value! :-(
>>>>
>>>>I´m working here with Windows 98 (SE) and 512MB, but this can´t be the
>>>>reason, because when compiling the same WinChest sources with the
>>>>´Borland-C 5´ compiler there´s absolutely no problem with larger
>>>>hash sizes - even more than the physical 512MB are possible (of course
>>>>with swapping).
>>>>
>>>>This problem only arises with the version compiled with MS-VC++ 6.0,
>>>>and I have absolutely no idea, what could be the reason for it -
>>>>I´ve already searched through the help files and looked through all
>>>>compiler options, but I didn´t find anything, what could explain this
>>>>strange behaviour, and there also seem to exist no compiler options
>>>>related to this problem.
>>>>
>>>>So my question to all, which are more familiar with MS-VC++ 6.0 than I:
>>>>Is there any memory limit of 256MB in calloc() or mallcoc() in _priciple_
>>>>in this compiler, or is there still any compiler option (that maybe I´ve
>>>>not discovered yet), or do you eventually know _any_ other way to solve
>>>>this problem with this compiler?
>>>>
>>>>Really hoping to get some solution -
>>>>with my best regards,
>>>>Franz.
>>>
>>>hi franz,
>>>
>>>IIRC there is indeed a memory limit for malloc under visual C. you should use
>>>the windows memory allocation routines instead (virtualalloc / globalalloc). i
>>>remember i had to do this when i built the 8pc endgame database for checkers,
>>>where i had to allocate close to 1GB, there the malloc function didn't work any
>>>more.
>>>
>>>cheers
>>>  martin
>>
>>I did some programming in ANSI C, nothing in C++, quite a few years back and am
>>wondering if the solution mentioned here, virtualalloc / globalalloc, now makes
>>the code non-portable and specific for the windows platform.
>>
>>Thanks.
>>
>>Steve
>
>hi steve,
>
>IIRC you are right, those windows memory management functions are of course
>non-portable.
>but i believe there is no way around this if you want to access more than 256 MB
>at once. i have a book at home where the answer to this question is. i can look
>it up tonight if no one else has a good answer till then.
>
>cheers
>  martin
Thanks Martin.

I get the impression that Dann's code compiles for windows and works correctly
with the Borland compiler but not the MS compiler.  Is that a correct
understanding?

Steve



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.