os_memory.h revision 41750107496858a047afa8d81d20fe903f285a78
15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/**************************************************************************
25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright 2010 Vmware, Inc.
45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * All Rights Reserved.
55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Permission is hereby granted, free of charge, to any person obtaining a
75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * copy of this software and associated documentation files (the
85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * "Software"), to deal in the Software without restriction, including
95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * without limitation the rights to use, copy, modify, merge, publish,
105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * distribute, sub license, and/or sell copies of the Software, and to
115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * permit persons to whom the Software is furnished to do so, subject to
125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * the following conditions:
135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * The above copyright notice and this permission notice (including the
155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * next paragraph) shall be included in all copies or substantial portions
165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * of the Software.
175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles) * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
26e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch **************************************************************************/
275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/*
305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OS memory management abstractions
31e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch */
325c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
335c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#ifndef _OS_MEMORY_H_
3507a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch#define _OS_MEMORY_H_
3607a852d8c1953036774d8f3b65d18dcfea3bb4a2Ben Murdoch
375c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
38c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)#include "pipe/p_config.h"
395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "pipe/p_compiler.h"
405c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
41
42#if defined(PIPE_SUBSYSTEM_EMBEDDED)
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48void *
49os_malloc(size_t size);
50
51void *
52os_calloc(size_t count, size_t size);
53
54void
55os_free(void *ptr);
56
57void *
58os_realloc(void *ptr, size_t old_size, size_t new_size);
59
60void *
61os_malloc_aligned(size_t size, size_t alignment);
62
63void
64os_free_aligned(void *ptr);
65
66#ifdef __cplusplus
67}
68#endif
69
70#elif defined(PIPE_OS_WINDOWS) && defined(DEBUG) && !defined(DEBUG_MEMORY_IMPLEMENTATION)
71
72#  include "os_memory_debug.h"
73
74#elif defined(PIPE_SUBSYSTEM_WINDOWS_DISPLAY) || defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT)
75
76#  include "os_memory_win32k.h"
77
78#else
79
80#  include "os_memory_stdc.h"
81
82#endif
83
84#endif /* _OS_MEMORY_H_ */
85