Skip to content

Commit db375be

Browse files
committed
change abort() -> ddsrt_abort in core
1 parent 778fedb commit db375be

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

ports/freertos-posix/src/loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void vAssertCalled(unsigned long ulLine, const char * const pcFileName)
4949
fprintf(stderr, "[ASSERT] %s:%lu"LF, pcFileName, ulLine);
5050
}
5151
taskEXIT_CRITICAL();
52-
abort();
52+
ddsrt_abort();
5353
}
5454

5555
void vApplicationMallocFailedHook(void)

src/core/ddsc/src/dds_entity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,7 @@ dds_return_t dds_return_loan (dds_entity_t entity, void **buf, int32_t bufsz)
16291629
// bufsz <= 0 is accepted because it allows one to write:
16301630
//
16311631
// if (dds_return_loan(rd, buf, dds_take(rd, buf, ...)) < 0)
1632-
// abort();
1632+
// ddsrt_abort();
16331633
//
16341634
// with abort only being called if there is a real problem.
16351635
//

src/ddsrt/include/dds/ddsrt/heap.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ddsrt_set_allocator(
4949
*
5050
* @param[in] size The size, in bytes, of the block of memory to allocate.
5151
*
52-
* @returns A pointer to the allocated block of memory. abort() is called if
52+
* @returns A pointer to the allocated block of memory. ddsrt_abort() is called if
5353
* not enough free memory was available.
5454
*/
5555
DDS_EXPORT void *
@@ -85,7 +85,7 @@ ddsrt_attribute_alloc_size((1));
8585
* A non-NULL pointer, that must be freed is always returned, even if the sum
8686
* @count and @size equals zero.
8787
*
88-
* @returns A pointer to the allocated memory. abort() is called if not enough
88+
* @returns A pointer to the allocated memory. ddsrt_abort() is called if not enough
8989
* free memory was available.
9090
*/
9191
DDS_EXPORT void *
@@ -123,7 +123,7 @@ ddsrt_attribute_alloc_size((1,2));
123123
* pointed to by memblk and returns a pointer as if ddsrt_malloc_s(0) was
124124
* invoked. The returned pointer must be free'd with ddsrt_free.
125125
*
126-
* @returns A pointer to reallocated memory. Calls abort() if not enough free
126+
* @returns A pointer to reallocated memory. Calls ddsrt_abort() if not enough free
127127
* memory was available.
128128
*/
129129
DDS_EXPORT void *

src/ddsrt/src/heap/freertos/heap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void *ddsrt_malloc(size_t size)
5151
void *ptr;
5252

5353
if ((ptr = ddsrt_malloc_s(size)) == NULL) {
54-
abort();
54+
ddsrt_abort();
5555
}
5656

5757
return ptr;
@@ -80,7 +80,7 @@ void *ddsrt_calloc(size_t nmemb, size_t size)
8080
void *ptr = NULL;
8181

8282
if ((ptr = ddsrt_calloc_s(nmemb, size)) == NULL) {
83-
abort();
83+
ddsrt_abort();
8484
}
8585

8686
return ptr;
@@ -121,7 +121,7 @@ void *ddsrt_realloc(void *memblk, size_t size)
121121
void *ptr = NULL;
122122

123123
if ((ptr = ddsrt_realloc_s(memblk, size)) == NULL) {
124-
abort();
124+
ddsrt_abort();
125125
}
126126

127127
return ptr;

src/ddsrt/src/sync/freertos/sync.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void ddsrt_mutex_init(ddsrt_mutex_t *mutex)
2727
assert(mutex != NULL);
2828

2929
if ((sem = xSemaphoreCreateMutex()) == NULL) {
30-
abort();
30+
ddsrt_abort();
3131
}
3232

3333
(void)memset(mutex, 0, sizeof(*mutex));
@@ -136,11 +136,11 @@ void ddsrt_cond_init(ddsrt_cond_t *cond)
136136
assert(cond != NULL);
137137

138138
if (ddsrt_tasklist_init(&tasks) == -1) {
139-
abort();
139+
ddsrt_abort();
140140
}
141141
if ((sem = xSemaphoreCreateMutex()) == NULL) {
142142
ddsrt_tasklist_fini(&tasks);
143-
abort();
143+
ddsrt_abort();
144144
}
145145

146146
(void)memset(cond, 0, sizeof(*cond));
@@ -178,7 +178,7 @@ ddsrt_cond_waitfor(
178178

179179
switch ((rc = cond_timedwait(cond, mutex, reltime))) {
180180
case DDS_RETCODE_OUT_OF_RESOURCES:
181-
abort();
181+
ddsrt_abort();
182182
case DDS_RETCODE_TIMEOUT:
183183
return false;
184184
default:
@@ -207,7 +207,7 @@ ddsrt_cond_waituntil(
207207

208208
switch ((rc = cond_timedwait(cond, mutex, reltime))) {
209209
case DDS_RETCODE_OUT_OF_RESOURCES:
210-
abort();
210+
ddsrt_abort();
211211
case DDS_RETCODE_TIMEOUT:
212212
return false;
213213
default:
@@ -256,11 +256,11 @@ void ddsrt_rwlock_init(ddsrt_rwlock_t *rwlock)
256256
assert(rwlock != NULL);
257257

258258
if (ddsrt_tasklist_init(&tasks) == -1) {
259-
abort();
259+
ddsrt_abort();
260260
}
261261
if ((sem = xSemaphoreCreateMutex()) == NULL) {
262262
ddsrt_tasklist_fini(&tasks);
263-
abort();
263+
ddsrt_abort();
264264
}
265265

266266
memset(rwlock, 0, sizeof(*rwlock));

src/ddsrt/src/sync/windows/sync.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ddsrt_cond_wait(ddsrt_cond_t *cond, ddsrt_mutex_t *mutex)
6161
assert(mutex != NULL);
6262

6363
if (!SleepConditionVariableSRW(&cond->cond, &mutex->lock, INFINITE, 0)) {
64-
abort();
64+
ddsrt_abort();
6565
}
6666
}
6767

@@ -108,7 +108,7 @@ ddsrt_cond_waitfor(
108108
if (SleepConditionVariableSRW(&cond->cond, &mutex->lock, msecs, 0)) {
109109
return true;
110110
} else if (GetLastError() != ERROR_TIMEOUT) {
111-
abort();
111+
ddsrt_abort();
112112
}
113113

114114
return (dds_time() >= abstime) ? false : true;

src/ddsrt/src/threads/windows/threads.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ void ddsrt_thread_init(uint32_t reason)
457457
if (reason != DLL_PROCESS_ATTACH)
458458
return;
459459
if ((cleanup = TlsAlloc()) == TLS_OUT_OF_INDEXES)
460-
abort();
460+
ddsrt_abort();
461461
}
462462

463463
void ddsrt_thread_fini(uint32_t reason)

0 commit comments

Comments
 (0)