Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
maestro-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
maestro
maestro-core
Commits
3cdf7c9d
Commit
3cdf7c9d
authored
5 years ago
by
Utz-Uwe Haus
Browse files
Options
Downloads
Patches
Plain Diff
transport cleanups
parent
69e2d9db
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
transport/transport.c
+11
-11
11 additions, 11 deletions
transport/transport.c
with
11 additions
and
11 deletions
transport/transport.c
+
11
−
11
View file @
3cdf7c9d
...
...
@@ -73,21 +73,21 @@ mstro_transport_get_dst_buffer(mstro_cdo dst, size_t len, void** data)
return
MSTRO_FAIL
;
}
}
else
{
const
void
*
available_size
;
const
int64_t
*
available_size
;
enum
mstro_cdo_attr_value_type
type
;
status
=
mstro_cdo_attribute_get
(
dst
,
MSTRO_ATTR_CORE_CDO_SCOPE_LOCAL_SIZE
,
&
type
,
&
available_size
);
dst
,
MSTRO_ATTR_CORE_CDO_SCOPE_LOCAL_SIZE
,
&
type
,
(
const
void
**
)
&
available_size
);
if
(
status
!=
MSTRO_OK
)
{
ERR
(
"Failed to fetch size attribute
\n
"
);
return
MSTRO_FAIL
;
}
if
(
*
(
const
int64_t
*
)
available_size
<
len
)
{
ERR
(
"local CDO handle has raw-ptr allocation, but it is too small for incoming CDO: have %
zu, need %zu
\n
"
,
*
(
const
int64_t
*
)
available_size
,
len
);
if
(
*
available_size
<
len
)
{
ERR
(
"local CDO handle has raw-ptr allocation, but it is too small for incoming CDO: have %
"
PRIi64
", need %"
PRIi64
"
\n
"
,
*
available_size
,
len
);
return
MSTRO_FAIL
;
}
else
{
DEBUG
(
"Pre-allocated RAW-PTR (have %
zu, need %zu
), good
\n
"
,
*
(
const
int64_t
*
)
available_size
,
len
);
DEBUG
(
"Pre-allocated RAW-PTR (have %
"
PRIi64
", need %"
PRIi64
"
), good
\n
"
,
*
available_size
,
len
);
*
data
=
dst
->
raw_ptr
;
}
}
...
...
@@ -99,23 +99,23 @@ mstro_status
mstro_transport_get_datalen
(
mstro_cdo
src
,
struct
mstro_transport_datalen
*
dl
)
{
enum
mstro_cdo_attr_value_type
type
;
const
void
*
val
;
const
int64_t
*
val
;
if
(
src
->
raw_ptr
!=
NULL
)
{
INFO
(
"Found a raw ptr in CDO %s
\n
"
,
src
->
name
);
dl
->
data
=
src
->
raw_ptr
;
if
(
!
(
MSTRO_OK
==
mstro_cdo_attribute_get
(
src
,
MSTRO_ATTR_CORE_CDO_SCOPE_LOCAL_SIZE
,
&
type
,
&
val
)))
{
src
,
MSTRO_ATTR_CORE_CDO_SCOPE_LOCAL_SIZE
,
&
type
,
(
const
void
**
)
&
val
)))
{
ERR
(
"Failed to get size attribute of CDO %s for transport
\n
"
,
src
->
name
);
return
MSTRO_FAIL
;
}
dl
->
len
=
*
(
size_t
*
)
val
;
dl
->
len
=
*
val
;
INFO
(
"CDO size is %zu
\n
"
,
dl
->
len
);
}
else
if
(
src
->
mamba_array
!=
NULL
)
{
mmbArray
*
ma
=
src
->
mamba_array
;
dl
->
data
=
(
char
*
)
ma
->
allocation
->
ptr
;
dl
->
len
=
(
size_t
)
ma
->
allocation
->
n_bytes
;
dl
->
len
=
ma
->
allocation
->
n_bytes
;
}
else
{
ERR
(
"Failed to find a raw pointer or a Mamba array to transport from CDO %s
\n
"
,
src
->
name
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment