MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / init_b2b_htables

Function init_b2b_htables

modules/b2b_entities/dlg.c:1621–1646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1619}
1620
1621int init_b2b_htables(void)
1622{
1623 int i;
1624
1625 server_htable = (b2b_table)shm_malloc(server_hsize* sizeof(b2b_entry_t));
1626 client_htable = (b2b_table)shm_malloc(client_hsize* sizeof(b2b_entry_t));
1627 if(!server_htable || !client_htable)
1628 ERR_MEM(SHARE_MEM);
1629
1630 memset(server_htable, 0, server_hsize* sizeof(b2b_entry_t));
1631 memset(client_htable, 0, client_hsize* sizeof(b2b_entry_t));
1632 for(i= 0; i< server_hsize; i++)
1633 {
1634 lock_init(&server_htable[i].lock);
1635 }
1636
1637 for(i= 0; i< client_hsize; i++)
1638 {
1639 lock_init(&client_htable[i].lock);
1640 }
1641
1642 return 0;
1643
1644error:
1645 return -1;
1646}
1647
1648void destroy_b2b_htables(void)
1649{

Callers 1

mod_initFunction · 0.85

Calls 2

shm_mallocFunction · 0.85
lock_initFunction · 0.85

Tested by

no test coverage detected