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()
261 …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()
290 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
297 shm_varpos = php_check_shm_data(shm_list_ptr->ptr, shm_key); in PHP_FUNCTION()
303 shm_var = (sysvshm_chunk*) ((char *)shm_list_ptr->ptr + shm_varpos); in PHP_FUNCTION()
327 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
332 RETURN_BOOL(php_check_shm_data(shm_list_ptr->ptr, shm_key) >= 0); in PHP_FUNCTION()
348 if (!shm_list_ptr->ptr) { in PHP_FUNCTION()
353 shm_varpos = php_check_shm_data(shm_list_ptr->ptr, shm_key); in PHP_FUNCTION()
359 php_remove_shm_data((shm_list_ptr->ptr), shm_varpos); in PHP_FUNCTION()
366 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
374 if ((shm_varpos = php_check_shm_data(ptr, key)) > 0) { in php_put_shm_data()
375 php_remove_shm_data(ptr, shm_varpos); in php_put_shm_data()
378 if (ptr->free < total_size) { in php_put_shm_data()
382 shm_var = (sysvshm_chunk *) ((char *) ptr + ptr->end); in php_put_shm_data()
387 ptr->end += total_size; in php_put_shm_data()
388 ptr->free -= total_size; in php_put_shm_data()
394 static zend_long php_check_shm_data(sysvshm_chunk_head *ptr, zend_long key) in php_check_shm_data() argument
399 ZEND_ASSERT(ptr); in php_check_shm_data()
401 pos = ptr->start; in php_check_shm_data()
404 if (pos >= ptr->end) { in php_check_shm_data()
407 shm_var = (sysvshm_chunk*) ((char *) ptr + pos); in php_check_shm_data()
413 if (shm_var->next <= 0 || pos < ptr->start) { in php_check_shm_data()
422 static int php_remove_shm_data(sysvshm_chunk_head *ptr, zend_long shm_varpos) in php_remove_shm_data() argument
427 ZEND_ASSERT(ptr); in php_remove_shm_data()
429 chunk_ptr = (sysvshm_chunk *) ((char *) ptr + shm_varpos); in php_remove_shm_data()
430 next_chunk_ptr = (sysvshm_chunk *) ((char *) ptr + shm_varpos + chunk_ptr->next); in php_remove_shm_data()
432 memcpy_len = ptr->end-shm_varpos - chunk_ptr->next; in php_remove_shm_data()
433 ptr->free += chunk_ptr->next; in php_remove_shm_data()
434 ptr->end -= chunk_ptr->next; in php_remove_shm_data()