Home > Database > Mysql Tutorial > eXtremeDB 数据库大小定义注意事项

eXtremeDB 数据库大小定义注意事项

WBOY
Release: 2016-06-07 15:47:19
Original
1200 people have browsed it

之前在eXtremeDB上做个小测试,在这个测试中,为eXtremeDB分配2G的内存,定义如下 #define DATABSE_SIZE 2*1024*1024*1024 发现内存分配不成功,经过检查后才知道: 上述的定义在宏替换时会默认是int类型,而int类型的表达范围为: -2*1024*1024*1024 ~2*102

之前在eXtremeDB上做个小测试,在这个测试中,为eXtremeDB分配2G的内存,定义如下

#define DATABSE_SIZE 2*1024*1024*1024

发现内存分配不成功,经过检查后才知道:

上述的定义在宏替换时会默认是int类型,而int类型的表达范围为:

-2*1024*1024*1024 ~ 2*1024*1024*1024-1

所以导致了内存的分配不成功,正确的定义应该为:

#define DATABSE_SIZE 2*1024*1024*1024L

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template