A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update copyright lines for 2023.
[simgrid.git]
/
tools
/
cmake
/
test_prog
/
prog_makecontext.c
diff --git
a/tools/cmake/test_prog/prog_makecontext.c
b/tools/cmake/test_prog/prog_makecontext.c
index a3fffe9c2ad4093658d0a0f2e99e30598d624fe9..7637bab1fcd1656ec2813a0b5408be34ae21fc7a 100644
(file)
--- a/
tools/cmake/test_prog/prog_makecontext.c
+++ b/
tools/cmake/test_prog/prog_makecontext.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2010
, 2014, 2016. The SimGrid Team. All rights reserved.
*/
+/* Copyright (c) 2010
-2023. The SimGrid Team. All rights reserved.
*/
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-11,6
+11,7
@@
#include <stdlib.h>
#include <ucontext.h>
#include <stdlib.h>
#include <ucontext.h>
+unsigned char *stack[64 * 1024];
ucontext_t uc_child;
ucontext_t uc_main;
ucontext_t uc_child;
ucontext_t uc_main;
@@
-23,15
+24,11
@@
static void child(void)
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
- void *stack = malloc(64 * 1024);
-
/* configure a child user-space context */
/* configure a child user-space context */
- if (stack == NULL)
- exit(3);
if (getcontext(&uc_child) != 0)
exit(4);
uc_child.uc_link = NULL;
if (getcontext(&uc_child) != 0)
exit(4);
uc_child.uc_link = NULL;
- uc_child.uc_stack.ss_sp
= (char *)
stack + (32 * 1024);
+ uc_child.uc_stack.ss_sp
=
stack + (32 * 1024);
uc_child.uc_stack.ss_size = 32 * 1024;
uc_child.uc_stack.ss_flags = 0;
makecontext(&uc_child, child, 0);
uc_child.uc_stack.ss_size = 32 * 1024;
uc_child.uc_stack.ss_flags = 0;
makecontext(&uc_child, child, 0);