Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
mbedtls
Commits
128657d6
Commit
128657d6
authored
Dec 18, 2014
by
Manuel Pégourié-Gonnard
Browse files
Use memory_buffer_alloc() in benchmark if available
Allows to measure memory by primitive.
parent
b8ca7231
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
programs/test/benchmark.c
programs/test/benchmark.c
+15
-3
No files found.
programs/test/benchmark.c
View file @
128657d6
...
...
@@ -61,9 +61,8 @@
#include "polarssl/ecdh.h"
#include "polarssl/error.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C)
#include "polarssl/memory_buffer_alloc.h"
#endif
#if defined _MSC_VER && !defined snprintf
...
...
@@ -182,6 +181,9 @@ int main( int argc, char *argv[] )
unsigned
char
tmp
[
200
];
char
title
[
TITLE_LEN
];
todo_list
todo
;
#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C)
unsigned
char
malloc_buf
[
1000000
]
=
{
0
};
#endif
if
(
argc
==
1
)
memset
(
&
todo
,
1
,
sizeof
(
todo
)
);
...
...
@@ -243,6 +245,9 @@ int main( int argc, char *argv[] )
polarssl_printf
(
"
\n
"
);
#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C)
memory_buffer_alloc_init
(
malloc_buf
,
sizeof
(
malloc_buf
)
);
#endif
memset
(
buf
,
0xAA
,
sizeof
(
buf
)
);
memset
(
tmp
,
0xBB
,
sizeof
(
tmp
)
);
...
...
@@ -642,6 +647,13 @@ int main( int argc, char *argv[] )
#endif
polarssl_printf
(
"
\n
"
);
#if defined(POLARSSL_MEMORY_BUFFER_ALLOC_C)
#if defined(POLARSSL_MEMORY_DEBUG)
memory_buffer_alloc_status
();
#endif
memory_buffer_alloc_free
();
#endif
#if defined(_WIN32)
polarssl_printf
(
" Press Enter to exit this program.
\n
"
);
fflush
(
stdout
);
getchar
();
...
...
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