hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

Why UserClass no extends Sweepable Class?

Open huzhiguang opened this issue 14 years ago • 2 comments

All UserClass no extends Sweepable class,if I edit source let all classes extends Sweepable,whether affect program?

I have edited source code: src\compiler\statement\Class_Statement.cpp 379 line code: source: cg_printf(" : public ObjectData"); to: cg_printf(" : public ObjectData,public Sweepable");

add after src\compiler\statement\Class_Statement.cpp 592 line code: //add hiphop __destruct functoin std::set ::iterator destruct_fun=done.find("__destruct"); //_destrcut exists if(destruct_fun!=done.end()){ cg_printf("public :~c%s(){t___destruct();}\n",clsName); }

change front code ,and then hiphop can let all classess support __desturct function,this way edit code whether affect program?Beacause have edited current program can call function have implement desturct function. so please author give me some suggest ,thanks.

huzhiguang avatar Oct 12 '12 05:10 huzhiguang

HipHop will call the __destruct method when an object's refcount drops to 0, except for objects that are still live at the end of the request.

Sweepable is used to a different purpose. Sweepable is used to ensure that all native resources (malloc'd memory, file descriptors, etc) are released at the end of the request.

paroski avatar Oct 12 '12 21:10 paroski

We're closing out all bugs older than 2 months. http://www.hiphop-php.com/wp/?p=575

If this is still an issue, please re-open it, and in order of goodness:

  1. Give detailed repro steps
  2. Write a test case in hphp/tests/quick (run it with hphp/tests/run) and send the pull request
  3. Fix it in a pull request

ptarjan avatar May 13 '13 21:05 ptarjan