Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
46a7e963
Commit
46a7e963
authored
Mar 02, 2023
by
Julius Goryavsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move alloca() definition from all *.h files to one new header file
parent
66b21ed5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
32 deletions
+56
-32
include/CMakeLists.txt
include/CMakeLists.txt
+2
-0
include/my_alloca.h
include/my_alloca.h
+45
-0
include/my_global.h
include/my_global.h
+1
-7
include/my_sys.h
include/my_sys.h
+1
-13
include/mysql/service_encryption.h
include/mysql/service_encryption.h
+4
-7
plugin/cracklib_password_check/cracklib_password_check.c
plugin/cracklib_password_check/cracklib_password_check.c
+1
-1
plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp
plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp
+1
-4
plugin/handler_socket/libhsclient/allocator.hpp
plugin/handler_socket/libhsclient/allocator.hpp
+1
-0
No files found.
include/CMakeLists.txt
View file @
46a7e963
...
...
@@ -37,6 +37,7 @@ SET(HEADERS
ma_dyncol.h
my_list.h
my_alloc.h
my_alloca.h
typelib.h
my_dbug.h
m_string.h
...
...
@@ -105,6 +106,7 @@ ENDMACRO()
INSTALL_COMPAT_HEADER
(
my_global.h
""
)
INSTALL_COMPAT_HEADER
(
my_config.h
""
)
INSTALL_COMPAT_HEADER
(
my_alloca.h
""
)
INSTALL_COMPAT_HEADER
(
my_sys.h
""
)
INSTALL_COMPAT_HEADER
(
mysql_version.h
"
#include <mariadb_version.h>
...
...
include/my_alloca.h
0 → 100644
View file @
46a7e963
/* Copyright (c) 2023, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
#ifndef MY_ALLOCA_INCLUDED
#define MY_ALLOCA_INCLUDED
#ifdef _WIN32
#include <malloc.h>
/*for alloca*/
/*
MSVC may define "alloca" when compiling in /Ze mode
(with extensions from Microsoft), but otherwise only
the _alloca function is defined:
*/
#ifndef alloca
#define alloca _alloca
#endif
#else
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#endif
#if defined(HAVE_ALLOCA)
/*
If the GCC/LLVM compiler from the MinGW is used,
alloca may not be defined when using the MSVC CRT:
*/
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && !defined(alloca)
#define alloca __builtin_alloca
#endif
/* GNUC */
#endif
#endif
/* MY_ALLOCA_INCLUDED */
include/my_global.h
View file @
46a7e963
...
...
@@ -358,13 +358,6 @@ C_MODE_END
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#if defined(__cplusplus) && defined(NO_CPLUSPLUS_ALLOCA)
#undef HAVE_ALLOCA
#undef HAVE_ALLOCA_H
#endif
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include <errno.h>
/* Recommended by debian */
/* We need the following to go around a problem with openssl on solaris */
...
...
@@ -521,6 +514,7 @@ typedef unsigned short ushort;
#endif
#include <my_compiler.h>
#include <my_alloca.h>
/*
Wen using the embedded library, users might run into link problems,
...
...
include/my_sys.h
View file @
46a7e963
...
...
@@ -36,9 +36,7 @@ typedef struct my_aio_result {
#include <m_ctype.h>
/* for CHARSET_INFO */
#include <stdarg.h>
#include <typelib.h>
#ifdef _WIN32
#include <malloc.h>
/*for alloca*/
#endif
#include <my_alloca.h>
#include <mysql/plugin.h>
#include <mysql/service_my_print_error.h>
...
...
@@ -196,16 +194,6 @@ my_bool my_test_if_atomic_write(File handle, int pagesize);
extern
my_bool
my_may_have_atomic_write
;
#if defined(HAVE_ALLOCA) && !defined(HAVE_valgrind)
#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
#pragma alloca
#endif
/* _AIX */
#if defined(__MWERKS__)
#undef alloca
#define alloca _alloca
#endif
/* __MWERKS__ */
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca)
#define alloca __builtin_alloca
#endif
/* GNUC */
#define my_alloca(SZ) alloca((size_t) (SZ))
#define my_afree(PTR) ((void)0)
#define MAX_ALLOCA_SZ 4096
...
...
include/mysql/service_encryption.h
View file @
46a7e963
...
...
@@ -24,22 +24,19 @@
*provider* (encryption plugin).
*/
#ifdef __cplusplus
extern
"C"
{
#endif
#ifndef MYSQL_ABI_CHECK
#include <my_alloca.h>
#ifdef _WIN32
#include <malloc.h>
#ifndef __cplusplus
#define inline __inline
#endif
#else
#include <stdlib.h>
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
/* returned from encryption_key_get_latest_version() */
...
...
plugin/cracklib_password_check/cracklib_password_check.c
View file @
46a7e963
...
...
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
#include <my_
global
.h>
#include <my_
alloca
.h>
#include <mysql/plugin_password_validation.h>
#include <crack.h>
#include <string.h>
...
...
plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp
View file @
46a7e963
...
...
@@ -6,7 +6,7 @@
* See COPYRIGHT.txt for details.
*/
#include <my_
global
.h>
#include <my_
alloca
.h>
#include <netinet/in.h>
#include <errno.h>
#include <poll.h>
...
...
@@ -17,9 +17,6 @@
#if __linux__
#include <sys/epoll.h>
#endif
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include "hstcpsvr_worker.hpp"
#include "string_buffer.hpp"
...
...
plugin/handler_socket/libhsclient/allocator.hpp
View file @
46a7e963
...
...
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <string.h>
#include <my_alloca.h>
#if 0
extern "C" {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment