麻辣堂|资源主站|开发论坛|在线手册
首页 Apache Linux Java MySQL 注册帮助 
PHP项目开发组是PHP开发资源网于2007组年建成立的项目开发团队,目前核心开发成员有27人, 项目协作成员8名.下设7个开发组,主要承接大/中型网站项目开发任务。

    由于开发任务较多,人员比较紧张,现面向社会招聘全职或者兼职开发人员,不管你是在校大学生,还是全职开发人员,以及SOHO都可以联系本站,我们可以长期合作,并为您带来丰厚的报酬。
  您现在的位置:PHP开发资源网 > 麻辣堂 > 详细资料
待解决
新写一个php的内存共享类(大家讨论下我遇到的问题)
悬赏分:20 - 2007年08月22日

[php]<?php
class Memory_Control{
var $shm_id="";
var $shm_key=0xfb3;
var $shm_mode="c";
var $shm_purview=0644;
var $shm_size=100;
var $shm_str="";
//构造函数
function Memory_Control($shm_key=0xfb3,$shm_mode="c",$shm_purview=0644,$shm_size=0){
$this->shm_key=$shm_key;
$this->shm_mode=$shm_mode;
$this->shm_purview=$shm_purview;
$this->shm_size=$shm_size;
$this->shm_id=shmop_open($this->shm_key, $this->shm_mode, $this->shm_purview, $this->shm_size);
$this->shm_size=shmop_size($this->shm_id);
}
//读取函数
function Memory_Read($start=0,$count=""){
if($count=="")
$count=$this->shm_size;
$this->shm_str=shmop_read($this->shm_id, $start, $count);
return $this->shm_str;
}
//写入函数
function Memory_Write($writ_str,$start=0){
$len=shmop_write($this->shm_id, $writ_str, $start);
return $len;
}
//删除函数
function Memory_Delete(){
shmop_delete($this->shm_id);
}
function Memory_Close(){
shmop_close($this->shm_id);
}
}
$memoryop=new Memory_Control(0xff3,"c",0644,0);
$str=$memoryop->Memory_Read();
echo $str;
$str=intval($str);
$str=$str+1;
$memoryop->Memory_Write($str,0);
$memoryop->Memory_Delete();
$memoryop->Memory_Close();
?>[/php]


为什么执行了$memoryop->Memory_Delete();以后内存里的值没有被释放呢?

提问者:phlice   08-22 11:11
答复
路过。。。顺便帮顶:)
回答者:玉米づ冰冻可乐 - 瓦岗村民 8-22 09:10
我也来回答:
不管你有没有帮助我们,瓦岗寨8万村民将感谢你。。。。。

为防止灌水,您需要计算一道数学题: 答案:
51 + 74 = ? 请将计算结果填在上面

 
[]
©2007 PhpRes.COM