Skip to content

Commit

Permalink
Debug stackleft.
Browse files Browse the repository at this point in the history
  • Loading branch information
insertinterestingnamehere committed Nov 7, 2023
1 parent 11f05bc commit 8659e0d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/basics/qthread_stackleft.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ static aligned_t x = 0;

static aligned_t alldone;

Q_NOINLINE size_t thread2(size_t left,
size_t depth)
#ifdef __clang__
#define STACKLEFT_NOINLINE __attribute__((optnone))
#elif __GNUC__
#define STACKLEFT_NOINLINE __attribute__((optimize(0)))
#else
#define STACKLEFT_NOINLINE
#endif

static STACKLEFT_NOINLINE size_t thread2(size_t left,
size_t depth)
{
size_t foo = qthread_stackleft();
iprintf("leveli%i: %zu bytes left\n", (int)depth, foo);
Expand Down

0 comments on commit 8659e0d

Please sign in to comment.