Browse code

tsilo: convert to memory logging helper

Henning Westerholt authored on 13/02/2020 21:50:30
Showing 1 changed files
... ...
@@ -74,7 +74,7 @@ int init_ts_table(unsigned int size)
74 74
 
75 75
 	t_table = (struct ts_table*)shm_malloc( sizeof(struct ts_table));
76 76
 	if (t_table==0) {
77
-		LM_ERR("no more shm mem (1)\n");
77
+		SHM_MEM_ERROR;
78 78
 		return -1;
79 79
 	}
80 80
 
... ...
@@ -104,7 +104,7 @@ int init_ts_table(unsigned int size)
104 104
 
105 105
 	t_table->entries = (ts_entry_t*)shm_malloc(sizeof(ts_entry_t) * size);
106 106
 	if (!t_table->entries) {
107
-		LM_ERR("no more shm mem (2)\n");
107
+		SHM_MEM_ERROR;
108 108
 		goto error;
109 109
 	}
110 110
 
... ...
@@ -210,14 +210,14 @@ int new_ts_urecord(str* ruri, ts_urecord_t** _r)
210 210
 {
211 211
 	*_r = (ts_urecord_t*)shm_malloc(sizeof(ts_urecord_t));
212 212
 	if (*_r == 0) {
213
-		LM_ERR("no more share memory\n");
213
+		SHM_MEM_ERROR;
214 214
 		return -1;
215 215
 	}
216 216
 	memset(*_r, 0, sizeof(ts_urecord_t));
217 217
 
218 218
 	(*_r)->ruri.s = (char*)shm_malloc(ruri->len);
219 219
 	if ((*_r)->ruri.s == 0) {
220
-		LM_ERR("no more share memory\n");
220
+		SHM_MEM_ERROR;
221 221
 		shm_free(*_r);
222 222
 		*_r = 0;
223 223
 		return -2;
... ...
@@ -362,7 +362,7 @@ ts_transaction_t* new_ts_transaction(int tindex, int tlabel)
362 362
 	len = sizeof(ts_transaction_t);
363 363
 	ts = (ts_transaction_t*)shm_malloc(len);
364 364
 	if (ts==0) {
365
-		LM_ERR("no more shm mem (%d)\n",len);
365
+		SHM_MEM_ERROR_FMT("len %d\n", len);
366 366
 		return 0;
367 367
 	}
368 368
 
... ...
@@ -388,7 +388,7 @@ ts_transaction_t* clone_ts_transaction(ts_transaction_t* ts)
388 388
 	len = sizeof(ts_transaction_t);
389 389
 	ts_clone = (ts_transaction_t*)shm_malloc(len);
390 390
 	if (ts_clone==NULL) {
391
-		LM_ERR("no more shm mem (%d)\n",len);
391
+		SHM_MEM_ERROR_FMT("len %d\n", len);
392 392
 		return NULL;
393 393
 	}
394 394