Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
canghaiwuhen
OpenXG-RAN
Commits
4bc36627
Commit
4bc36627
authored
Jul 07, 2020
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some used but not initialized variables
parent
4d6e647a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
common/utils/ocp_itti/intertask_interface.cpp
common/utils/ocp_itti/intertask_interface.cpp
+11
-3
No files found.
common/utils/ocp_itti/intertask_interface.cpp
View file @
4bc36627
...
...
@@ -80,7 +80,7 @@ task_list_t tasks[TASK_MAX];
void
*
itti_malloc
(
task_id_t
origin_task_id
,
task_id_t
destination_task_id
,
ssize_t
size
)
{
void
*
ptr
=
NULL
;
AssertFatal
((
ptr
=
malloc
(
size
))
!=
NULL
,
"Memory allocation of %zu bytes failed (%d -> %d)!
\n
"
,
AssertFatal
((
ptr
=
calloc
(
size
,
1
))
!=
NULL
,
"Memory allocation of %zu bytes failed (%d -> %d)!
\n
"
,
size
,
origin_task_id
,
destination_task_id
);
return
ptr
;
}
...
...
@@ -91,8 +91,16 @@ task_list_t tasks[TASK_MAX];
return
(
EXIT_SUCCESS
);
}
// in the two following functions, the +32 in malloc is there to deal with gcc memory alignment
// because a struct size can be larger than sum(sizeof(struct components))
// We should remove the itti principle of a huge union for all types of messages in paramter "msg_t ittiMsg"
// to use a more C classical pointer casting "void * ittiMsg", later casted in the right struct
// but we would have to change all legacy macros, as per this example
// #define S1AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_register_enb_req
// would become
// #define S1AP_REGISTER_ENB_REQ(mSGpTR) (s1ap_register_enb_req) mSGpTR)->ittiMsg
MessageDef
*
itti_alloc_new_message_sized
(
task_id_t
origin_task_id
,
MessagesIds
message_id
,
MessageHeaderSize
size
)
{
MessageDef
*
temp
=
(
MessageDef
*
)
itti_malloc
(
origin_task_id
,
TASK_UNKNOWN
,
sizeof
(
MessageHeader
)
+
size
);
MessageDef
*
temp
=
(
MessageDef
*
)
itti_malloc
(
origin_task_id
,
TASK_UNKNOWN
,
sizeof
(
MessageHeader
)
+
32
+
size
);
temp
->
ittiMsgHeader
.
messageId
=
message_id
;
temp
->
ittiMsgHeader
.
originTaskId
=
origin_task_id
;
temp
->
ittiMsgHeader
.
ittiMsgSize
=
size
;
...
...
@@ -100,7 +108,7 @@ task_list_t tasks[TASK_MAX];
}
MessageDef
*
itti_alloc_new_message
(
task_id_t
origin_task_id
,
MessagesIds
message_id
)
{
int
size
=
sizeof
(
MessageHeader
)
+
messages_info
[
message_id
].
size
;
int
size
=
sizeof
(
MessageHeader
)
+
32
+
messages_info
[
message_id
].
size
;
MessageDef
*
temp
=
(
MessageDef
*
)
itti_malloc
(
origin_task_id
,
TASK_UNKNOWN
,
size
);
temp
->
ittiMsgHeader
.
messageId
=
message_id
;
temp
->
ittiMsgHeader
.
originTaskId
=
origin_task_id
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment