Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions erpc_c/port/erpc_config_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,12 @@
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
#if !defined(ERPC_CODEC_COUNT)
#define ERPC_CODEC_COUNT (2U)
#warning "ERPC_CODEC_COUNT is not defined. Default is used."
#endif
#if !defined(ERPC_MESSAGE_LOGGERS_COUNT)
#define ERPC_MESSAGE_LOGGERS_COUNT (0U)
#warning "ERPC_MESSAGE_LOGGERS_COUNT is not defined. Default is used."
#endif
#if !defined(ERPC_CLIENTS_THREADS_AMOUNT)
#define ERPC_CLIENTS_THREADS_AMOUNT (1U)
#warning "ERPC_CLIENTS_THREADS_AMOUNT is not defined. Default is used."
#endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion erpcgen/src/templates/c_server_header.template
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef void * erpc_service_t;
erpc_service_t create_{$iface.serviceClassName}(void);

#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
void destroy_{$iface.serviceClassName}(erpc_service_t *service);
void destroy_{$iface.serviceClassName}(erpc_service_t service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
void destroy_{$iface.serviceClassName}(void);
#else
Expand Down
6 changes: 3 additions & 3 deletions erpcgen/src/templates/c_server_source.template
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ erpc_service_t create_{$iface.serviceClassName}()
return new (nothrow) {$iface.serviceClassName}();
}

void destroy_{$iface.serviceClassName}(erpc_service_t *service)
void destroy_{$iface.serviceClassName}(erpc_service_t service)
{
if (*service)
if (service)
{
delete service;
delete ({$iface.serviceClassName} *)service;
}
}
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
Expand Down
17 changes: 0 additions & 17 deletions erpcgen/test/test_dynamic_ann_c.yml

This file was deleted.

48 changes: 48 additions & 0 deletions erpcgen/test/test_service_c.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: static
desc: dynamic annotation is not used.
idl: |
program test

interface ErrorTest{
oneway f()
}

test_server.h:
- erpc_service_t create_ErrorTest_service(void);

- "#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC"
- void destroy_ErrorTest_service(erpc_service_t service);
- "#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC"
- void destroy_ErrorTest_service(void);
- "#else"
- "#warning \"Unknown eRPC allocation policy!\""
- "#endif"

test_server.cpp:
- ERPC_MANUALLY_CONSTRUCTED_STATIC(ErrorTest_service, s_ErrorTest_service);
- "#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC"
- erpc_service_t create_ErrorTest_service()
- "{"
- return new (nothrow) ErrorTest_service();
- "}"
- void destroy_ErrorTest_service(erpc_service_t service)
- "{"
- if (service)
- "{"
- delete (ErrorTest_service *)service;
- "}"
- "}"
- "#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC"
- erpc_service_t create_ErrorTest_service()
- "{"
- s_ErrorTest_service.construct();
- return s_ErrorTest_service.get();
- "}"
- void destroy_ErrorTest_service()
- "{"
- s_ErrorTest_service.destroy();
- "}"
- "#else"
- "#warning \"Unknown eRPC allocation policy!\""
- "#endif"
2 changes: 1 addition & 1 deletion test/common/config/erpc_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
//! ERPC_MESSAGE_LOGGING_DISABLED.
//!
//! Uncomment for using logging feature.
#define ERPC_MESSAGE_LOGGING (ERPC_MESSAGE_LOGGING_ENABLED)
// #define ERPC_MESSAGE_LOGGING (ERPC_MESSAGE_LOGGING_ENABLED)

//! @def ERPC_TRANSPORT_MU_USE_MCMGR
//!
Expand Down
2 changes: 1 addition & 1 deletion test/test_arbitrator/config/erpc_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
//! ERPC_MESSAGE_LOGGING_DISABLED.
//!
//! Uncomment for using logging feature.
#define ERPC_MESSAGE_LOGGING (ERPC_MESSAGE_LOGGING_ENABLED)
// #define ERPC_MESSAGE_LOGGING (ERPC_MESSAGE_LOGGING_ENABLED)

//! @def ERPC_TRANSPORT_MU_USE_MCMGR
//!
Expand Down
4 changes: 2 additions & 2 deletions test/test_arrays/test_arrays_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ void remove_services_from_server()
{
erpc_remove_service_from_server(service_test);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_PointersService_service((erpc_service_t *)service_test);
destroy_PointersService_service(service_test);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_PointersService_service();
#endif
Expand All @@ -427,7 +427,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_binary/test_binary_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void remove_services_from_server()
{
erpc_remove_service_from_server(service_test);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Binary_service((erpc_service_t *)service_test);
destroy_Binary_service(service_test);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Binary_service();
#endif
Expand All @@ -127,7 +127,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_builtin/test_builtin_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void remove_services_from_server()
{
erpc_remove_service_from_server(service_test);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_BuiltinServices_service((erpc_service_t *)service_test);
destroy_BuiltinServices_service(service_test);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_BuiltinServices_service();
#endif
Expand All @@ -203,7 +203,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_callbacks/test_callbacks_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void remove_services_from_server()
{
erpc_remove_service_from_server(service_test);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_ClientCore0Services_service((erpc_service_t *)service_test);
destroy_ClientCore0Services_service(service_test);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_ClientCore0Services_service();
#endif
Expand All @@ -136,7 +136,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down
2 changes: 1 addition & 1 deletion test/test_const/test_const_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_enums/test_enums_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void remove_services_from_server()
{
erpc_remove_service_from_server(service_test);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_EnumsService_service((erpc_service_t *)service_test);
destroy_EnumsService_service(service_test);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_EnumsService_service();
#endif
Expand All @@ -128,7 +128,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_lists/test_lists_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ void remove_services_from_server()
{
erpc_remove_service_from_server(service_test);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_PointersService_service((erpc_service_t *)service_test);
destroy_PointersService_service(service_test);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_PointersService_service();
#endif
Expand All @@ -362,7 +362,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_shared/test_shared_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void remove_services_from_server()
{
erpc_remove_service_from_server(service_test);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_SharedService_service((erpc_service_t *)service_test);
destroy_SharedService_service(service_test);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_SharedService_service();
#endif
Expand All @@ -82,7 +82,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down
6 changes: 3 additions & 3 deletions test/test_struct/test_struct_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ void remove_services_from_server()
erpc_remove_service_from_server(service1);
erpc_remove_service_from_server(service2);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_ArithmeticService1_service((erpc_service_t *)service1);
destroy_ArithmeticService2_service((erpc_service_t *)service2);
destroy_ArithmeticService1_service(service1);
destroy_ArithmeticService2_service(service2);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_ArithmeticService1_service();
destroy_ArithmeticService2_service();
Expand All @@ -242,7 +242,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_typedef/test_typedef_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void remove_services_from_server()
{
erpc_remove_service_from_server(service_test);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_TypedefService_service((erpc_service_t *)service_test);
destroy_TypedefService_service(service_test);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_TypedefService_service();
#endif
Expand All @@ -182,7 +182,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down
4 changes: 2 additions & 2 deletions test/test_unions/test_unions_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void remove_services_from_server()
{
erpc_remove_service_from_server(service_test);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_ArithmeticService_service((erpc_service_t *)service_test);
destroy_ArithmeticService_service(service_test);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_ArithmeticService_service();
#endif
Expand All @@ -260,7 +260,7 @@ void remove_common_services_from_server(erpc_service_t service)
{
erpc_remove_service_from_server(service);
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
destroy_Common_service((erpc_service_t *)service);
destroy_Common_service(service);
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
destroy_Common_service();
#endif
Expand Down