Delphi 5在64位上出现内存错误

时间:2022-05-09 17:36:02

I wrote a program in Delphi 5 whcih runs ok on my Windows 8 32 bit pc. I find that running it on my Windows 7 64bit laptop eventually causes a reallocmem error which does not happen on the 32 bit pc. I inserted the following

我在Delphi 5中编写了一个程序,在我的Windows 8 32位PC上运行正常。我发现在我的Windows 7 64位笔记本电脑上运行它最终会导致重新分配错误,这在32位电脑上不会发生。我插入以下内容

MS.dwLength := SizeOf(MemoryStatus);
GlobalMemoryStatus(MS);

On the 32bit pc the size never changes but on the the 64bit laptop it fluctuates but over time gets smaller. Is there some general mechanism in running 32bit Delphi 5 on a 64bit machine that makes this likely?

在32位PC上尺寸永远不会改变,但在64位笔记本电脑上它会波动,但随着时间的推移变小。在64位计算机上运行32位Delphi 5是否有一些通用的机制可以实现这一点?

1 个解决方案

#1


Is there some general mechanism in running 32bit Delphi 5 on a 64bit machine that makes this likely?

在64位计算机上运行32位Delphi 5是否有一些通用的机制可以实现这一点?

If you have marked your application as LARGEADDRESSAWARE by modifying the PE flags post-build, then you may encounter problems because the Borland memory manager is not compatible with address >2GB.

如果您通过修改构建后的PE标志将应用程序标记为LARGEADDRESSAWARE,则可能会遇到问题,因为Borland内存管理器与地址> 2GB不兼容。

If your application is not LARGEADDRESSAWARE then there is no obvious reason for it to fail on a 64 bit machine but not on a 32 bit machine. In which case the most plausible explanation is nothing more prosaic than your code having a defect that needs to be debugged.

如果您的应用程序不是LARGEADDRESSAWARE,那么没有明显的理由让它在64位计算机上失败而在32位计算机上失败。在这种情况下,最合理的解释并不比具有需要调试的缺陷的代码更平淡无奇。

#1


Is there some general mechanism in running 32bit Delphi 5 on a 64bit machine that makes this likely?

在64位计算机上运行32位Delphi 5是否有一些通用的机制可以实现这一点?

If you have marked your application as LARGEADDRESSAWARE by modifying the PE flags post-build, then you may encounter problems because the Borland memory manager is not compatible with address >2GB.

如果您通过修改构建后的PE标志将应用程序标记为LARGEADDRESSAWARE,则可能会遇到问题,因为Borland内存管理器与地址> 2GB不兼容。

If your application is not LARGEADDRESSAWARE then there is no obvious reason for it to fail on a 64 bit machine but not on a 32 bit machine. In which case the most plausible explanation is nothing more prosaic than your code having a defect that needs to be debugged.

如果您的应用程序不是LARGEADDRESSAWARE,那么没有明显的理由让它在64位计算机上失败而在32位计算机上失败。在这种情况下,最合理的解释并不比具有需要调试的缺陷的代码更平淡无奇。