Lines Matching refs:ptr
64 if (sysvshm->ptr) { in sysvshm_free_obj()
65 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);
183 shm_list_ptr->ptr = chunk_ptr; in PHP_FUNCTION()
198 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
203 shmdt((void *) shm_list_ptr->ptr); in PHP_FUNCTION()
204 shm_list_ptr->ptr = NULL; in PHP_FUNCTION()
221 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
250 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
260 if (UNEXPECTED(!shm_list_ptr->ptr)) { in PHP_FUNCTION()
267 …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()
296 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
303 shm_varpos = php_check_shm_data(shm_list_ptr->ptr, shm_key); in PHP_FUNCTION()
309 shm_var = (sysvshm_chunk*) ((char *)shm_list_ptr->ptr + shm_varpos); in PHP_FUNCTION()
333 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
338 RETURN_BOOL(php_check_shm_data(shm_list_ptr->ptr, shm_key) >= 0); in PHP_FUNCTION()
354 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
359 shm_varpos = php_check_shm_data(shm_list_ptr->ptr, shm_key); in PHP_FUNCTION()
365 php_remove_shm_data((shm_list_ptr->ptr), shm_varpos); in PHP_FUNCTION()
372 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
380 if ((shm_varpos = php_check_shm_data(ptr, key)) > 0) { in php_put_shm_data()
381 php_remove_shm_data(ptr, shm_varpos); in php_put_shm_data()
384 if (ptr->free < total_size) { in php_put_shm_data()
388 shm_var = (sysvshm_chunk *) ((char *) ptr + ptr->end); in php_put_shm_data()
393 ptr->end += total_size; in php_put_shm_data()
394 ptr->free -= total_size; in php_put_shm_data()
400 static zend_long php_check_shm_data(sysvshm_chunk_head *ptr, zend_long key) in php_check_shm_data() argument
405 ZEND_ASSERT(ptr); in php_check_shm_data()
407 pos = ptr->start; in php_check_shm_data()
410 if (pos >= ptr->end) { in php_check_shm_data()
413 shm_var = (sysvshm_chunk*) ((char *) ptr + pos); in php_check_shm_data()
419 if (shm_var->next <= 0 || pos < ptr->start) { in php_check_shm_data()
428 static int php_remove_shm_data(sysvshm_chunk_head *ptr, zend_long shm_varpos) in php_remove_shm_data() argument
433 ZEND_ASSERT(ptr); in php_remove_shm_data()
435 chunk_ptr = (sysvshm_chunk *) ((char *) ptr + shm_varpos); in php_remove_shm_data()
436 next_chunk_ptr = (sysvshm_chunk *) ((char *) ptr + shm_varpos + chunk_ptr->next); in php_remove_shm_data()
438 memcpy_len = ptr->end-shm_varpos - chunk_ptr->next; in php_remove_shm_data()
439 ptr->free += chunk_ptr->next; in php_remove_shm_data()
440 ptr->end -= chunk_ptr->next; in php_remove_shm_data()