您的位置:首页 > 编程语言 > PHP开发

PHP 关于Memory函数

2016-04-20 00:00 435 查看
void shmop_close ( int
$shmid
)
— Close shared memory block

bool shmop_delete ( int
$shmid
)
— Delete shared memory block
成功时返回
TRUE
, 或者在失败时返回
FALSE


int shmop_open ( int
$key
, string
$flags
, int
$mode
, int
$size
)
— Create or open shared memory block
key -System's id for the shared memory block
flag - a c w n
mode -The permissions that you wish to assign to your memory segment
size -The size of the shared memory block you wish to create in bytes

On success shmop_open() will return an id that you can use to access the shared memory segment you've created.
FALSE
is returned on failure.

string shmop_read ( int
$shmid
, int
$start
, int
$count
)
— Read data from shared memory block
Returns the data 或者在失败时返回
FALSE
.

int shmop_size ( int
$shmid
)
— Get size of shared memory block
Returns an int, which represents the number of bytes the shared memory block occupies.

int shmop_write ( int
$shmid
, string
$data
, int
$offset
)
— Write data into shared memory block

int memory_get_usage ([ bool
$real_usage
= false ] )
—返回当前分配给你的 PHP 脚本的内存量,单位是字节(byte)。

int memory_get_peak_usage ([ bool
$real_usage
= false ] )
返回分配给你的 PHP 脚本的内存峰值字节数。如果设置为
TRUE
可以获取从系统分配到的真实内存尺寸。 如果未设置,或者设置为
FALSE
,仅会报告 emalloc() 使用的内存。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: