Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
28ea8fad
authored
8 years ago
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed vc 2012 problems
parent
41af80bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
18 deletions
+19
-18
base_c/include/embb/base/c/atomic.h
+2
-1
base_c/src/memory_allocation.c
+10
-10
mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.c
+7
-7
No files found.
base_c/include/embb/base/c/atomic.h
View file @
28ea8fad
...
@@ -297,7 +297,6 @@ extern "C" {
...
@@ -297,7 +297,6 @@ extern "C" {
#ifdef EMBB_THREADING_ANALYSIS_MODE
#ifdef EMBB_THREADING_ANALYSIS_MODE
#include <embb/base/c/internal/platform.h>
#include <embb/base/c/internal/platform.h>
#include <assert.h>
int
embb_mutex_init
(
int
embb_mutex_init
(
embb_mutex_t
*
mutex
,
embb_mutex_t
*
mutex
,
...
@@ -332,6 +331,8 @@ void embb_mutex_destroy(
...
@@ -332,6 +331,8 @@ void embb_mutex_destroy(
#ifdef EMBB_DEBUG
#ifdef EMBB_DEBUG
#include <assert.h>
#define EMBB_ATOMIC_INIT_CHECK(variable) assert(variable->marker == 0x12345678)
#define EMBB_ATOMIC_INIT_CHECK(variable) assert(variable->marker == 0x12345678)
#define EMBB_ATOMIC_INIT_MARKER(variable) variable->marker = 0x12345678
#define EMBB_ATOMIC_INIT_MARKER(variable) variable->marker = 0x12345678
...
...
This diff is collapsed.
Click to expand it.
base_c/src/memory_allocation.c
View file @
28ea8fad
...
@@ -49,8 +49,8 @@ void* embb_alloc(size_t bytes) {
...
@@ -49,8 +49,8 @@ void* embb_alloc(size_t bytes) {
if
(
allocated
==
NULL
)
if
(
allocated
==
NULL
)
return
NULL
;
return
NULL
;
embb_internal__atomic_fetch_and_add_4
(
embb_internal__atomic_fetch_and_add_4
(
&
embb_bytes_allocated
,
&
embb_bytes_allocated
,
(
long
)
bytes_to_allocate
);
(
EMBB_BASE_BASIC_TYPE_SIZE_4
)
bytes_to_allocate
);
size_t
*
x_as_size_type
=
(
size_t
*
)
allocated
;
size_t
*
x_as_size_type
=
(
size_t
*
)
allocated
;
...
@@ -72,8 +72,8 @@ void embb_free(void * ptr) {
...
@@ -72,8 +72,8 @@ void embb_free(void * ptr) {
(
*
alloc_type
)
=
(
size_t
)
INVALID_ALLOCATION
;
(
*
alloc_type
)
=
(
size_t
)
INVALID_ALLOCATION
;
embb_internal__atomic_fetch_and_add_4
(
embb_internal__atomic_fetch_and_add_4
(
&
embb_bytes_allocated
,
&
embb_bytes_allocated
,
(
long
)(
0
-
(
size_t
)(
*
bytes_allocated
)));
(
EMBB_BASE_BASIC_TYPE_SIZE_4
)(
0
-
(
size_t
)(
*
bytes_allocated
)));
free
((
size_t
*
)
ptr
-
2
);
free
((
size_t
*
)
ptr
-
2
);
}
}
...
@@ -127,8 +127,8 @@ void* embb_alloc_aligned(size_t alignment, size_t size) {
...
@@ -127,8 +127,8 @@ void* embb_alloc_aligned(size_t alignment, size_t size) {
x_as_size_type
[
-
2
]
=
(
size_t
)
allocated
;
x_as_size_type
[
-
2
]
=
(
size_t
)
allocated
;
x_as_size_type
[
-
3
]
=
bytes_to_allocate
;
x_as_size_type
[
-
3
]
=
bytes_to_allocate
;
embb_internal__atomic_fetch_and_add_4
(
embb_internal__atomic_fetch_and_add_4
(
&
embb_bytes_allocated
,
&
embb_bytes_allocated
,
(
long
)
bytes_to_allocate
);
(
EMBB_BASE_BASIC_TYPE_SIZE_4
)
bytes_to_allocate
);
return
x
;
return
x
;
}
}
...
@@ -138,14 +138,14 @@ void embb_free_aligned(void* ptr) {
...
@@ -138,14 +138,14 @@ void embb_free_aligned(void* ptr) {
size_t
*
ptr_conv
=
(
size_t
*
)
ptr
;
size_t
*
ptr_conv
=
(
size_t
*
)
ptr
;
// If embb_free_aligned is called, the memory block should have been
allocated
// If embb_free_aligned is called, the memory block should have been
// using embb_alloc_aligned.
//
allocated
using embb_alloc_aligned.
assert
(
ptr_conv
[
-
1
]
==
ALIGNED_ALLOCATION
);
assert
(
ptr_conv
[
-
1
]
==
ALIGNED_ALLOCATION
);
ptr_conv
[
-
1
]
=
(
size_t
)
INVALID_ALLOCATION
;
ptr_conv
[
-
1
]
=
(
size_t
)
INVALID_ALLOCATION
;
embb_internal__atomic_fetch_and_add_4
(
embb_internal__atomic_fetch_and_add_4
(
&
embb_bytes_allocated
,
&
embb_bytes_allocated
,
(
long
)((
long
)
0
-
ptr_conv
[
-
3
]));
(
EMBB_BASE_BASIC_TYPE_SIZE_4
)((
long
)
0
-
ptr_conv
[
-
3
]));
free
((
void
*
)
ptr_conv
[
-
2
]);
free
((
void
*
)
ptr_conv
[
-
2
]);
}
}
...
...
This diff is collapsed.
Click to expand it.
mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.c
View file @
28ea8fad
...
@@ -811,13 +811,13 @@ static void network_task_start(
...
@@ -811,13 +811,13 @@ static void network_task_start(
int
actual
=
0
;
int
actual
=
0
;
// expected counts bytes we intended to put into the buffer
// expected counts bytes we intended to put into the buffer
int
expected
=
int
expected
=
4
+
// operation
4
+
// operation
4
+
// domain_id
4
+
// domain_id
4
+
// job_id
4
+
// job_id
4
+
// priority
4
+
// priority
4
+
4
+
// task handle
4
+
4
+
// task handle
4
+
// result_size
4
+
// result_size
4
+
local_task
->
arguments_size
;
// arguments buffer
4
+
(
int
)
local_task
->
arguments_size
;
// arguments buffer
// packet size
// packet size
actual
+=
embb_mtapi_network_buffer_push_back_int32
(
actual
+=
embb_mtapi_network_buffer_push_back_int32
(
...
...
This diff is collapsed.
Click to expand it.
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