Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
magic-lantern
magic-lantern
Commits
766ffbb4be33
Commit
bc0404b1
authored
Feb 23, 2018
by
alex@thinkpad
Browse files
exmem: speed-up shoot_malloc
(1s timeout probably not needed) --HG-- branch : memory-backend
parent
51f6129949d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/exmem.c
View file @
766ffbb4
...
...
@@ -133,7 +133,7 @@ static struct memSuite *shoot_malloc_suite_int(size_t size, int relaxed)
AllocateMemoryResource
(
size
,
allocCBR
,
(
unsigned
int
)
suite_info
,
0x50
);
int
r
=
take_semaphore
(
suite_info
->
sem
,
100
0
);
int
r
=
take_semaphore
(
suite_info
->
sem
,
100
);
if
(
r
)
{
suite_info
->
timed_out
=
1
;
...
...
@@ -161,11 +161,11 @@ struct memSuite *_shoot_malloc_suite(size_t size)
else
{
/* allocate some backup that will service the queued allocation request that fails during the loop */
int
backup_size
=
8
*
1024
*
1024
;
int
backup_size
=
4
*
1024
*
1024
;
int
max_size
=
0
;
struct
memSuite
*
backup
=
shoot_malloc_suite_int
(
backup_size
,
0
);
for
(
int
size
=
4
;
size
<
1024
;
size
+=
4
)
for
(
int
size
=
4
;
size
<
1024
;
size
+=
4
)
{
struct
memSuite
*
testSuite
=
shoot_malloc_suite_int
(
size
*
1024
*
1024
,
1
);
if
(
testSuite
)
...
...
@@ -201,7 +201,7 @@ struct memSuite * _shoot_malloc_suite_contig(size_t size)
AllocateContinuousMemoryResource
(
size
,
allocCBR
,
(
unsigned
int
)
suite_info
,
0x50
);
int
r
=
take_semaphore
(
suite_info
->
sem
,
100
0
);
int
r
=
take_semaphore
(
suite_info
->
sem
,
100
);
if
(
r
)
{
suite_info
->
timed_out
=
1
;
...
...
@@ -280,7 +280,7 @@ void exmem_test()
msleep(2000);
AllocateMemoryResource(1024*1024*32, allocCBR, (unsigned int)&hSuite, 0x50);
int r = take_semaphore(alloc_sem, 100
0
);
int r = take_semaphore(alloc_sem, 100);
if (r) return;
if(!hSuite)
...
...
Write
Preview
Supports
Markdown
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