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
26b96094
Commit
26b96094
authored
Apr 27, 2023
by
Yasuhiro-gh
Committed by
Daniel Black
Jul 12, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-23865 Create malloc function attribute
parent
cee9b3b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
include/my_compiler.h
include/my_compiler.h
+5
-0
mysys/my_malloc.c
mysys/my_malloc.c
+1
-0
No files found.
include/my_compiler.h
View file @
26b96094
...
...
@@ -156,6 +156,7 @@ program. The paths leading to call of cold functions within code are
marked as unlikely by the branch prediction mechanism. optimize a
rarely invoked function for size instead for speed. */
# define ATTRIBUTE_COLD __attribute__((cold))
# define ATTRIBUTE_MALLOC __attribute__((malloc))
#elif defined _MSC_VER
# define ATTRIBUTE_NORETURN __declspec(noreturn)
# define ATTRIBUTE_NOINLINE __declspec(noinline)
...
...
@@ -168,6 +169,10 @@ rarely invoked function for size instead for speed. */
# define ATTRIBUTE_COLD
/* empty */
#endif
#ifndef ATTRIBUTE_MALLOC
# define ATTRIBUTE_MALLOC
#endif
#include <my_attribute.h>
#endif
/* MY_COMPILER_INCLUDED */
mysys/my_malloc.c
View file @
26b96094
...
...
@@ -62,6 +62,7 @@ void set_malloc_size_cb(MALLOC_SIZE_CB func)
@return A pointer to the allocated memory block, or NULL on failure.
*/
ATTRIBUTE_MALLOC
void
*
my_malloc
(
PSI_memory_key
key
,
size_t
size
,
myf
my_flags
)
{
my_memory_header
*
mh
;
...
...
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