MySQL  8.0.18
Source Code Documentation
check_stack.cc File Reference
#include "sql/check_stack.h"
#include "my_config.h"
#include <stdio.h>
#include <algorithm>
#include <atomic>
#include <new>
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "mysql_com.h"
#include "mysqld_error.h"
#include "sql/current_thd.h"
#include "sql/derror.h"
#include "sql/sql_class.h"

Macros

#define used_stack(A, B)   (long)(B - A)
 

Functions

bool check_stack_overrun (const THD *thd, long margin, unsigned char *buf)
 Check stack for a overrun. More...
 

Variables

std::atomic< long > max_stack_used
 

Macro Definition Documentation

◆ used_stack

#define used_stack (   A,
 
)    (long)(B - A)

Function Documentation

◆ check_stack_overrun()

bool check_stack_overrun ( const THD thd,
long  margin,
unsigned char *  buf 
)

Check stack for a overrun.

Parameters
thdThread handler.
marginMinimal acceptable unused space in the stack.
bufSee a note below.
Returns
false if success, true if error (reported).
Note
Note: The 'buf' parameter is necessary, even if it is unused here.
  • fix_fields functions has a "dummy" buffer large enough for the corresponding exec. (Thus we only have to check in fix_fields.)
  • Passing to check_stack_overrun() prevents the compiler from removing it.

Variable Documentation

◆ max_stack_used

std::atomic<long> max_stack_used