Lines Matching refs:ptr

65 	if (sysvshm->ptr) {  in sysvshm_free_obj()
66 shmdt((void *) sysvshm->ptr); in sysvshm_free_obj()
95 static int php_put_shm_data(sysvshm_chunk_head *ptr, zend_long key, const char *data, zend_long len…
96 static zend_long php_check_shm_data(sysvshm_chunk_head *ptr, zend_long key);
97 static int php_remove_shm_data(sysvshm_chunk_head *ptr, zend_long shm_varpos);
188 shm_list_ptr->ptr = chunk_ptr; in PHP_FUNCTION()
203 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
208 shmdt((void *) shm_list_ptr->ptr); in PHP_FUNCTION()
209 shm_list_ptr->ptr = NULL; in PHP_FUNCTION()
226 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
255 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
266 …ret = php_put_shm_data(shm_list_ptr->ptr, shm_key, shm_var.s? ZSTR_VAL(shm_var.s) : NULL, shm_var.… in PHP_FUNCTION()
295 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
302 shm_varpos = php_check_shm_data(shm_list_ptr->ptr, shm_key); in PHP_FUNCTION()
308 shm_var = (sysvshm_chunk*) ((char *)shm_list_ptr->ptr + shm_varpos); in PHP_FUNCTION()
332 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
337 RETURN_BOOL(php_check_shm_data(shm_list_ptr->ptr, shm_key) >= 0); in PHP_FUNCTION()
353 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
358 shm_varpos = php_check_shm_data(shm_list_ptr->ptr, shm_key); in PHP_FUNCTION()
364 php_remove_shm_data((shm_list_ptr->ptr), shm_varpos); in PHP_FUNCTION()
371 static int php_put_shm_data(sysvshm_chunk_head *ptr, zend_long key, const char *data, zend_long len) in php_put_shm_data() argument
379 if ((shm_varpos = php_check_shm_data(ptr, key)) > 0) { in php_put_shm_data()
380 php_remove_shm_data(ptr, shm_varpos); in php_put_shm_data()
383 if (ptr->free < total_size) { in php_put_shm_data()
387 shm_var = (sysvshm_chunk *) ((char *) ptr + ptr->end); in php_put_shm_data()
392 ptr->end += total_size; in php_put_shm_data()
393 ptr->free -= total_size; in php_put_shm_data()
399 static zend_long php_check_shm_data(sysvshm_chunk_head *ptr, zend_long key) in php_check_shm_data() argument
404 ZEND_ASSERT(ptr); in php_check_shm_data()
406 pos = ptr->start; in php_check_shm_data()
409 if (pos >= ptr->end) { in php_check_shm_data()
412 shm_var = (sysvshm_chunk*) ((char *) ptr + pos); in php_check_shm_data()
418 if (shm_var->next <= 0 || pos < ptr->start) { in php_check_shm_data()
427 static int php_remove_shm_data(sysvshm_chunk_head *ptr, zend_long shm_varpos) in php_remove_shm_data() argument
432 ZEND_ASSERT(ptr); in php_remove_shm_data()
434 chunk_ptr = (sysvshm_chunk *) ((char *) ptr + shm_varpos); in php_remove_shm_data()
435 next_chunk_ptr = (sysvshm_chunk *) ((char *) ptr + shm_varpos + chunk_ptr->next); in php_remove_shm_data()
437 memcpy_len = ptr->end-shm_varpos - chunk_ptr->next; in php_remove_shm_data()
438 ptr->free += chunk_ptr->next; in php_remove_shm_data()
439 ptr->end -= chunk_ptr->next; in php_remove_shm_data()