ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
deferred_resn
demangler
enum
forall-pointer-decay
jacob/cs343-translation
jenkins-sandbox
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
with_gc
Last change
on this file since f77dbc0 was 863c413, checked in by Thierry Delisle <tdelisle@…>, 7 years ago |
Fixed processor test which was missing calls to delete
|
-
Property mode
set to
100644
|
File size:
496 bytes
|
Line | |
---|
1 | #include <kernel>
|
---|
2 | #include <thread>
|
---|
3 | #include <time>
|
---|
4 |
|
---|
5 | #ifndef PREEMPTION_RATE
|
---|
6 | #error PREEMPTION_RATE not defined in makefile
|
---|
7 | #endif
|
---|
8 |
|
---|
9 | Duration default_preemption() {
|
---|
10 | return PREEMPTION_RATE;
|
---|
11 | }
|
---|
12 |
|
---|
13 | static const unsigned long N = 5_000ul;
|
---|
14 |
|
---|
15 | int main(int argc, char* argv[]) {
|
---|
16 | processor * p[15];
|
---|
17 | for ( int pi = 0; pi < 15; pi++ ) {
|
---|
18 | p[pi] = new();
|
---|
19 | }
|
---|
20 | for ( int i = 0; i < N; i++) {
|
---|
21 | int pi = i % 15;
|
---|
22 | delete( p[pi] );
|
---|
23 | p[pi] = new();
|
---|
24 | }
|
---|
25 | for ( int pi = 0; pi < 15; pi++ ) {
|
---|
26 | delete( p[pi] );
|
---|
27 | }
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.