Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-libraries
Commits
2d214027
Verified
Commit
2d214027
authored
Jul 28, 2020
by
Camil Staps
Browse files
Support packed arrays in GraphCopy
parent
2228eeb2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Libraries/graph_copy/copy_graph_to_string.c
View file @
2d214027
...
...
@@ -32,7 +32,7 @@ int is_using_desc_relative_to_array (void)
#endif
}
extern
void
*
INT
,
*
CHAR
,
*
BOOL
,
*
REAL
,
*
__STRING__
,
*
__ARRAY__
;
extern
void
*
INT
,
*
INT32
,
*
CHAR
,
*
BOOL
,
*
REAL
,
*
REAL32
,
*
__STRING__
,
*
__ARRAY__
;
/* 2 for callgraph profiling. When this is turned on, we need to ignore the
* last part of thunks, as it is used for the saved cost centre stack. */
...
...
Libraries/graph_copy/copy_graph_to_string_implementation.c
View file @
2d214027
...
...
@@ -122,6 +122,9 @@ for (;;){
}
else
if
(
elem_desc
==
(
Int
)
&
INT
+
2
#if ARCH_64
||
elem_desc
==
(
Int
)
&
REAL
+
2
#else
||
elem_desc
==
(
Int
)
&
INT32
+
2
||
elem_desc
==
(
Int
)
&
REAL32
+
2
#endif
){
if
(
heap_p
+
array_size
>
(
Int
*
)
stack_begin
)
...
...
@@ -130,7 +133,17 @@ for (;;){
copy
(
heap_p
,
node_p
,
array_size
);
heap_p
+=
array_size
;
break
;
#if ! ARCH_64
#if ARCH_64
}
else
if
(
elem_desc
==
(
Int
)
&
INT32
+
2
||
elem_desc
==
(
Int
)
&
REAL32
+
2
){
array_size
=
(
array_size
+
1
)
>>
1
;
if
(
heap_p
+
array_size
>
(
Int
*
)
stack_begin
)
return
NULL
;
copy
(
heap_p
,
node_p
,
array_size
);
heap_p
+=
array_size
;
break
;
#else
}
else
if
(
elem_desc
==
(
Int
)
&
REAL
+
2
){
array_size
<<=
1
;
...
...
Libraries/graph_copy/copy_string_to_graph.c
View file @
2d214027
...
...
@@ -23,7 +23,7 @@
# define USE_DESC_RELATIVE_TO_ARRAY 1
#endif
extern
void
*
INT
,
*
CHAR
,
*
BOOL
,
*
REAL
,
*
__STRING__
,
*
__ARRAY__
;
extern
void
*
INT
,
*
INT32
,
*
CHAR
,
*
BOOL
,
*
REAL
,
*
REAL32
,
*
__STRING__
,
*
__ARRAY__
;
extern
Int
small_integers
[],
static_characters
[];
/* 2 for callgraph profiling. In this case, we need to add a pointer argument
...
...
@@ -110,10 +110,17 @@ void remove_forwarding_pointers_from_string (Int *string_p,Int *end_forwarding_p
}
else
if
(
elem_desc
==
(
Int
)
&
INT
+
2
#if ARCH_64
||
elem_desc
==
(
Int
)
&
REAL
+
2
#else
||
elem_desc
==
(
Int
)
&
INT32
+
2
||
elem_desc
==
(
Int
)
&
REAL32
+
2
#endif
){
string_p
+=
array_size
;
#if ! ARCH_64
#if ARCH_64
}
else
if
(
elem_desc
==
(
Int
)
&
INT32
+
2
||
elem_desc
==
(
Int
)
&
REAL32
+
2
){
array_size
=
(
array_size
+
1
)
>>
1
;
string_p
+=
array_size
;
#else
}
else
if
(
elem_desc
==
(
Int
)
&
REAL
+
2
){
array_size
<<=
1
;
string_p
+=
array_size
;
...
...
Libraries/graph_copy/copy_string_to_graph_implementation.c
View file @
2d214027
...
...
@@ -170,6 +170,9 @@ for (;;){
}
else
if
(
elem_desc
==
(
Int
)
&
INT
+
2
#if ARCH_64
||
elem_desc
==
(
Int
)
&
REAL
+
2
#else
||
elem_desc
==
(
Int
)
&
INT32
+
2
||
elem_desc
==
(
Int
)
&
REAL32
+
2
#endif
){
n_free_words
-=
array_size
;
...
...
@@ -182,7 +185,21 @@ for (;;){
string_p
+=
array_size
;
heap_p
+=
array_size
;
break
;
#if ! ARCH_64
#if ARCH_64
}
else
if
(
elem_desc
==
(
Int
)
&
INT32
+
2
||
elem_desc
==
(
Int
)
&
REAL32
+
2
){
array_size
=
(
array_size
+
1
)
>>
1
;
n_free_words
-=
array_size
;
if
(
n_free_words
<
0
){
*
last_heap_pa
=
heap_p
+
array_size
+
(
stack_end
-
stack_begin
);
return
(
Int
*
)((
Int
)
string_p
+
1
);
}
copy
(
heap_p
,
string_p
,
array_size
);
string_p
+=
array_size
;
heap_p
+=
array_size
;
break
;
#else
}
else
if
(
elem_desc
==
(
Int
)
&
REAL
+
2
){
array_size
<<=
1
;
...
...
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