~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/os/os0proc.c

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-24 15:33:01 UTC
  • mto: (968.2.18 mordred)
  • mto: This revision was merged to the branch mainline in revision 971.
  • Revision ID: osullivan.padraig@gmail.com-20090324153301-90gw63j1lsie1k9j
Removing a very mis-leading comment from sql_locale.cc

The comment was totally wrong and read "This file is build from
my_locale.pl"

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
13
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/**************************************************//**
20
 
@file os/os0proc.c
 
19
/******************************************************
21
20
The interface to the operating system
22
21
process control primitives
23
22
 
31
30
 
32
31
#include "ut0mem.h"
33
32
#include "ut0byte.h"
34
 
#include <errno.h>
35
 
#include <unistd.h>
36
33
 
37
34
/* FreeBSD for example has only MAP_ANON, Linux has MAP_ANONYMOUS and
38
35
MAP_ANON but MAP_ANON is marked as deprecated */
46
43
/* Large page size. This may be a boot-time option on some platforms */
47
44
UNIV_INTERN ulint os_large_page_size;
48
45
 
49
 
/****************************************************************//**
 
46
/********************************************************************
50
47
Converts the current process id to a number. It is not guaranteed that the
51
48
number is unique. In Linux returns the 'process number' of the current
52
49
thread. That number is the same as one sees in 'top', for example. In Linux
53
 
the thread id is not the same as one sees in 'top'.
54
 
@return process id as a number */
 
50
the thread id is not the same as one sees in 'top'. */
55
51
UNIV_INTERN
56
52
ulint
57
53
os_proc_get_number(void)
64
60
#endif
65
61
}
66
62
 
67
 
/****************************************************************//**
68
 
Allocates large pages memory.
69
 
@return allocated memory */
 
63
/********************************************************************
 
64
Allocates large pages memory. */
70
65
UNIV_INTERN
71
66
void*
72
67
os_mem_alloc_large(
73
68
/*===============*/
74
 
        ulint*  n)                      /*!< in/out: number of bytes */
 
69
                                        /* out: allocated memory */
 
70
        ulint*  n)                      /* in/out: number of bytes */
75
71
{
76
72
        void*   ptr;
77
73
        ulint   size;
99
95
                        fprintf(stderr, "InnoDB: HugeTLB: Warning: Failed to"
100
96
                                " attach shared memory segment, errno %d\n",
101
97
                                errno);
102
 
                        ptr = NULL;
103
98
                }
104
99
 
105
100
                /* Remove the shared memory segment so that it will be
147
142
                os_fast_mutex_unlock(&ut_list_mutex);
148
143
                UNIV_MEM_ALLOC(ptr, size);
149
144
        }
150
 
#elif !defined OS_MAP_ANON
 
145
#elif defined __NETWARE__ || !defined OS_MAP_ANON
151
146
        size = *n;
152
147
        ptr = ut_malloc_low(size, TRUE, FALSE);
153
148
#else
176
171
        return(ptr);
177
172
}
178
173
 
179
 
/****************************************************************//**
 
174
/********************************************************************
180
175
Frees large pages memory. */
181
176
UNIV_INTERN
182
177
void
183
178
os_mem_free_large(
184
179
/*==============*/
185
 
        void    *ptr,                   /*!< in: pointer returned by
 
180
        void    *ptr,                   /* in: pointer returned by
186
181
                                        os_mem_alloc_large() */
187
 
        ulint   size)                   /*!< in: size returned by
 
182
        ulint   size)                   /* in: size returned by
188
183
                                        os_mem_alloc_large() */
189
184
{
190
185
        os_fast_mutex_lock(&ut_list_mutex);
215
210
                os_fast_mutex_unlock(&ut_list_mutex);
216
211
                UNIV_MEM_FREE(ptr, size);
217
212
        }
218
 
#elif !defined OS_MAP_ANON
 
213
#elif defined __NETWARE__ || !defined OS_MAP_ANON
219
214
        ut_free(ptr);
220
215
#else
221
216
        if (munmap(ptr, size)) {
231
226
        }
232
227
#endif
233
228
}
 
229
 
 
230
/********************************************************************
 
231
Sets the priority boost for threads released from waiting within the current
 
232
process. */
 
233
UNIV_INTERN
 
234
void
 
235
os_process_set_priority_boost(
 
236
/*==========================*/
 
237
        ibool   do_boost)       /* in: TRUE if priority boost should be done,
 
238
                                FALSE if not */
 
239
{
 
240
#ifdef __WIN__
 
241
        ibool   no_boost;
 
242
 
 
243
        if (do_boost) {
 
244
                no_boost = FALSE;
 
245
        } else {
 
246
                no_boost = TRUE;
 
247
        }
 
248
 
 
249
#if TRUE != 1
 
250
# error "TRUE != 1"
 
251
#endif
 
252
 
 
253
        /* Does not do anything currently!
 
254
        SetProcessPriorityBoost(GetCurrentProcess(), no_boost);
 
255
        */
 
256
        fputs("Warning: process priority boost setting"
 
257
              " currently not functional!\n",
 
258
              stderr);
 
259
#else
 
260
        UT_NOT_USED(do_boost);
 
261
#endif
 
262
}