diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-04-25 11:06:16 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-04-25 11:06:16 -0400 |
commit | 4f1c1975b5f3d98321ad9e5b6f952c166d3606a7 (patch) | |
tree | 50c83e846f4a4d538b94bce41201d4a2847a852d /mysys | |
parent | 9c89b84d46e0645820acb9e3cc339af10c68cfb7 (diff) | |
parent | 0991e19e9d38f7475390276c0557c2390e4d93c9 (diff) | |
download | mariadb-git-4f1c1975b5f3d98321ad9e5b6f952c166d3606a7.tar.gz |
Merge tag 'mariadb-5.5.49' into 5.5-galera
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/default.c | 1 | ||||
-rw-r--r-- | mysys/lf_alloc-pin.c | 9 | ||||
-rw-r--r-- | mysys/my_copy.c | 1 | ||||
-rw-r--r-- | mysys/my_gethwaddr.c | 2 |
4 files changed, 10 insertions, 3 deletions
diff --git a/mysys/default.c b/mysys/default.c index c1f55a552dc..6f7ea583a1d 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -583,6 +583,7 @@ int my_load_defaults(const char *conf_file, const char **groups, handle_default_option, (void *) &ctx, dirs))) { + delete_dynamic(&args); free_root(&alloc,MYF(0)); DBUG_RETURN(error); } diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c index 6ab6ba3aae0..59f60f06696 100644 --- a/mysys/lf_alloc-pin.c +++ b/mysys/lf_alloc-pin.c @@ -103,6 +103,12 @@ #include <my_sys.h> #include <lf.h> +/* + when using alloca() leave at least that many bytes of the stack - + for functions we might be calling from within this stack frame +*/ +#define ALLOCA_SAFETY_MARGIN 8192 + #define LF_PINBOX_MAX_PINS 65536 static void _lf_pinbox_real_free(LF_PINS *pins); @@ -349,7 +355,8 @@ static void _lf_pinbox_real_free(LF_PINS *pins) { int alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins; /* create a sorted list of pinned addresses, to speed up searches */ - if (available_stack_size(&pinbox, *pins->stack_ends_here) > alloca_size) + if (available_stack_size(&pinbox, *pins->stack_ends_here) > + alloca_size + ALLOCA_SAFETY_MARGIN) { struct st_harvester hv; addr= (void **) alloca(alloca_size); diff --git a/mysys/my_copy.c b/mysys/my_copy.c index 21de1e953a2..82cb2cc2f5f 100644 --- a/mysys/my_copy.c +++ b/mysys/my_copy.c @@ -18,7 +18,6 @@ #include "mysys_err.h" #include <my_dir.h> /* for stat */ #include <m_string.h> -#include "mysys_err.h" #if defined(HAVE_UTIME_H) #include <utime.h> #elif defined(HAVE_SYS_UTIME_H) diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c index db026c13700..c7aa7f17f1d 100644 --- a/mysys/my_gethwaddr.c +++ b/mysys/my_gethwaddr.c @@ -72,7 +72,7 @@ err: return res; } -#elif defined(__linux__) || defined(__sun__) +#elif defined(__linux__) || defined(__sun) #include <net/if.h> #include <sys/ioctl.h> #include <net/if_arp.h> |