summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-03-23 22:36:46 +0100
committerSergei Golubchik <serg@mariadb.org>2016-03-23 22:36:46 +0100
commitf67a2211ec48b1b1502a7095c50cd9195d8235f8 (patch)
tree93e5d158a4a2a1dca4be915f8cf9dc79b3b6d96c /mysys
parenta75d26946423d2142921411bf7bdc731eba4df1a (diff)
parent2783fc7d14bc8ad16acfeb509d3b19615023f47a (diff)
downloadmariadb-git-f67a2211ec48b1b1502a7095c50cd9195d8235f8.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'mysys')
-rw-r--r--mysys/lf_alloc-pin.c9
-rw-r--r--mysys/mf_iocache2.c2
-rw-r--r--mysys/mf_keycache.c2
-rw-r--r--mysys/my_default.c2
-rw-r--r--mysys/my_delete.c2
-rw-r--r--mysys/my_lock.c4
6 files changed, 14 insertions, 7 deletions
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index f8a15829fb1..b349ef88ed1 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);
@@ -345,7 +351,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/mf_iocache2.c b/mysys/mf_iocache2.c
index 93caa7bc74a..2499094037d 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -44,7 +44,7 @@
RETURN VALUE
0 All OK
- 1 An error occured
+ 1 An error occurred
*/
int
my_b_copy_to_file(IO_CACHE *cache, FILE *file)
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 188a8d0429e..3077415b243 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -274,7 +274,7 @@ struct st_hash_link
};
/* simple states of a block */
-#define BLOCK_ERROR 1 /* an error occured when performing file i/o */
+#define BLOCK_ERROR 1 /* an error occurred when performing file i/o */
#define BLOCK_READ 2 /* file block is in the block buffer */
#define BLOCK_IN_SWITCH 4 /* block is preparing to read new page */
#define BLOCK_REASSIGNED 8 /* blk does not accept requests for old page */
diff --git a/mysys/my_default.c b/mysys/my_default.c
index 34ba9eef218..7f41551f779 100644
--- a/mysys/my_default.c
+++ b/mysys/my_default.c
@@ -363,7 +363,7 @@ err:
RETURN
0 - ok
- 1 - error occured
+ 1 - error occurred
*/
static int handle_default_option(void *in_ctx, const char *group_name,
diff --git a/mysys/my_delete.c b/mysys/my_delete.c
index e99c7ff5fcb..3dfe290dabe 100644
--- a/mysys/my_delete.c
+++ b/mysys/my_delete.c
@@ -110,7 +110,7 @@ static int my_win_unlink(const char *name)
if (handle != INVALID_HANDLE_VALUE)
{
/*
- We opened file without sharing flags (exclusive), noone else has this file
+ We opened file without sharing flags (exclusive), no one else has this file
opened, thus it is save to close handle to remove it. No renaming is
necessary.
*/
diff --git a/mysys/my_lock.c b/mysys/my_lock.c
index 0abbc6c3084..082d8e9f5a0 100644
--- a/mysys/my_lock.c
+++ b/mysys/my_lock.c
@@ -131,7 +131,7 @@ error:
RETURN VALUE
0 Success
- -1 An error has occured and 'my_errno' is set
+ -1 An error has occurred and 'my_errno' is set
to indicate the actual error code.
*/
@@ -203,7 +203,7 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
== MY_FILEPOS_ERROR)
{
/*
- If an error has occured in my_seek then we will already
+ If an error has occurred in my_seek then we will already
have an error code in my_errno; Just return error code.
*/
DBUG_RETURN(-1);