64位平台中的malloc [英] malloc in 64bit platform

查看:96
本文介绍了64位平台中的malloc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想分配一个大缓冲区,但是32位操作系统将其限制为小于2GB,将迁移到64位平台可以解决此问题,因为malloc函数的参数类型为size_t,在64位平台上为64位? ?如果可以,那么我们可以分配的最大大小是多少?
thanx

hi i want to allocate a large buffer, but the 32 bit OS limits it to less than 2GB, will migrating to 64 bit platform solve the problem, since malloc function has argument of type size_t which is 64 bit in 64bit platform?? If so than what is the maximum size we can allocate??
thanx

推荐答案

取决于要分配的内存量以及malloc的实现.我不知道Visual C ++有什么限制,但是Windows上的体系结构限制是每个进程8Tb(大约是32位Windows的2000倍).

干杯,



PS:大多数64位版本的Windows只能具有约128Gb的物理RAM,因此您可能会首先达到该限制.
Depends on how much memory you want to allocate and the implementation of malloc. I have no idea what the limit is with Visual C++ but there''s an architectural limit on Windows of 8Tb per process (about 2000 times what you''re used to with 32 bit windows).

Cheers,

Ash

PS: Most 64 bit versions of windows can only have ~128Gb of physical RAM so you''re probably going to hit that limit first.


这篇关于64位平台中的malloc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆