hi derick thanx for answering... do i understand it right? this function is used for generating a memory leak which you want to test? and whats about this function emalloc() ... i did not find it on php.net. i suppose it is used to alloc memory? regards, jürg zgraggen
"Derick Rethans" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Tue, 19 Nov 2002, Juerg Zgraggen wrote: > > > hi > > > > does anybody know how the function leak() works? > > can anybody explain? > > It leaks memory, by only running an emalloc without a free: > > /* {{{ proto void leak(int num_bytes=3) > Cause an intentional memory leak, for testing/debugging purposes */ > ZEND_FUNCTION(leak) > { > int leakbytes=3; > zval **leak; > > if (ZEND_NUM_ARGS()>=1) { > if (zend_get_parameters_ex(1, &leak)==SUCCESS) { > convert_to_long_ex(leak); > leakbytes = (*leak)->value.lval; > } > } > > emalloc(leakbytes); > } > /* }}} */ > > Derick > > -- > > -------------------------------------------------------------------------- - > Derick Rethans http://derickrethans.nl/ > JDI Media Solutions > --------------[ if you hold a unix shell to your ear, do you hear the c? ]- > -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php