MySQL  8.0.23
Source Code Documentation
os0proc.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1995, 2020, Oracle and/or its affiliates.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License, version 2.0, as published by the
7 Free Software Foundation.
8 
9 This program is also distributed with certain software (including but not
10 limited to OpenSSL) that is licensed under separate terms, as designated in a
11 particular file or component or in included license documentation. The authors
12 of MySQL hereby grant you an additional permission to link the program and
13 your derivative works with the separately licensed software that they have
14 included with MySQL.
15 
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
19 for more details.
20 
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 
25 *****************************************************************************/
26 
27 /** @file include/os0proc.h
28  The interface to the operating system
29  process control primitives
30 
31  Created 9/30/1995 Heikki Tuuri
32  *******************************************************/
33 
34 #ifndef os0proc_h
35 #define os0proc_h
36 
37 #include "univ.i"
38 
39 #ifdef UNIV_LINUX
40 #include <sys/ipc.h>
41 #include <sys/shm.h>
42 #endif
43 
44 typedef void *os_process_t;
45 typedef unsigned long int os_process_id_t;
46 
47 /** The total amount of memory currently allocated from the operating
48 system with os_mem_alloc_large(). */
49 extern std::atomic<ulint> os_total_large_mem_allocated;
50 
51 /** Whether to use large pages in the buffer pool */
52 extern bool os_use_large_pages;
53 
54 /** Large page size. This may be a boot-time option on some platforms */
56 
57 /** Converts the current process id to a number.
58 @return process id as a number */
59 ulint os_proc_get_number(void);
60 
61 /** Allocates large pages memory.
62 @param[in,out] n Number of bytes to allocate
63 @return allocated memory */
64 void *os_mem_alloc_large(ulint *n);
65 
66 /** Frees large pages memory.
67 @param[in] ptr pointer returned by os_mem_alloc_large()
68 @param[in] size size returned by os_mem_alloc_large() */
69 void os_mem_free_large(void *ptr, ulint size);
70 
71 #endif
os_mem_alloc_large
void * os_mem_alloc_large(ulint *n)
Allocates large pages memory.
Definition: os0proc.cc:76
os_proc_get_number
ulint os_proc_get_number(void)
Converts the current process id to a number.
Definition: os0proc.cc:65
n
int n
Definition: xcom_base.cc:445
os_process_id_t
unsigned long int os_process_id_t
Definition: os0proc.h:45
uint
unsigned int uint
Definition: uca-dump.cc:29
os_total_large_mem_allocated
std::atomic< ulint > os_total_large_mem_allocated
The total amount of memory currently allocated from the operating system with os_mem_alloc_large().
Definition: os0proc.cc:55
os_large_page_size
uint os_large_page_size
Large page size.
Definition: os0proc.cc:61
os_use_large_pages
bool os_use_large_pages
Whether to use large pages in the buffer pool.
Definition: os0proc.cc:58
os_process_t
void * os_process_t
Definition: os0proc.h:44
os_mem_free_large
void os_mem_free_large(void *ptr, ulint size)
Frees large pages memory.
Definition: os0proc.cc:167