Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PolyORB-HI-Ada
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TASTE
PolyORB-HI-Ada
Commits
73b59230
Commit
73b59230
authored
Apr 06, 2018
by
yoogx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Reorganize code to avoid usage of the secondary stack
For openaadl/ocarina#141
parent
926df680
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
20 deletions
+14
-20
src/polyorb_hi-messages.adb
src/polyorb_hi-messages.adb
+9
-4
src/polyorb_hi-messages.ads
src/polyorb_hi-messages.ads
+5
-16
No files found.
src/polyorb_hi-messages.adb
View file @
73b59230
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
8
ESA & ISAE. --
-- --
-- PolyORB-HI is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
...
...
@@ -77,14 +77,14 @@ package body PolyORB_HI.Messages is
L
:
constant
Stream_Element_Count
:=
Message
.
Last
+
Header_Size
;
R
:
Stream_Element_Array
(
1
..
L
)
:=
(
others
=>
0
);
P
:
constant
Stream_Element_Array
(
1
..
Length
(
Message
))
:=
Payload
(
Message
);
P
:
Stream_Element_Array
renames
Message
.
Content
(
Message
.
First
..
Message
.
Last
);
begin
R
(
1
..
Message_Length_Size
)
:=
To_Buffer
(
L
-
1
);
R
(
Receiver_Offset
)
:=
Stream_Element
(
Internal_Code
(
Entity
));
R
(
Sender_Offset
)
:=
Stream_Element
(
Internal_Code
(
From
));
R
(
Header_Size
+
1
..
Header_Size
+
Length
(
Message
))
:=
P
;
-- XXX GNATProve GPL 2014 limitation ?
return
R
;
end
Encapsulate
;
...
...
@@ -97,6 +97,11 @@ package body PolyORB_HI.Messages is
return
Corresponding_Entity
(
Unsigned_8
(
M
(
Sender_Offset
)));
end
Sender
;
function
Sender
(
M
:
Message_Type
)
return
Entity_Type
is
begin
return
Corresponding_Entity
(
Unsigned_8
(
M
.
Content
(
Sender_Offset
)));
end
Sender
;
----------
-- Read --
----------
...
...
src/polyorb_hi-messages.ads
View file @
73b59230
...
...
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
8
ESA & ISAE. --
-- --
-- PolyORB-HI is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
...
...
@@ -82,10 +82,6 @@ package PolyORB_HI.Messages is
procedure
Reallocate
(
M
:
in
out
Message_Type
);
-- Reset M
function
Payload
(
M
:
Message_Type
)
return
Stream_Element_Array
with
Pre
=>
(
Valid
(
M
));
-- Return the remaining payload of message M
function
Sender
(
M
:
Message_Type
)
return
Entity_Type
with
Pre
=>
(
Valid
(
M
));
function
Sender
(
M
:
Stream_Element_Array
)
return
Entity_Type
;
...
...
@@ -116,17 +112,10 @@ private
end
record
;
function
Valid
(
Message
:
Message_Type
)
return
Boolean
is
(
Message
.
First
>=
Message
.
Content
'
First
and
then
Message
.
Last
<=
Message
.
Content
'
Last
);
-- The following part cannot be correct in the case Message is
-- not initialized, see defaults for Message_Type
-- and then Message.First <= Message.Last
function
Payload
(
M
:
Message_Type
)
return
Stream_Element_Array
is
(
M
.
Content
(
M
.
First
..
M
.
Last
));
function
Sender
(
M
:
Message_Type
)
return
Entity_Type
is
(
Sender
(
Payload
(
M
)));
(
Message
.
First
>=
Message
.
Content
'
First
);
-- The following part cannot be correct in the case Message is
-- not initialized, see defaults for Message_Type
-- and then Message.First <= Message.Last
pragma
Inline
(
To_Length
);
pragma
Inline
(
To_Buffer
);
...
...
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