FastUIDraw
fastuidraw_memory_private.hpp
Go to the documentation of this file.
1 /*!
2  * \file fastuidraw_memory_private.hpp
3  * \brief file fastuidraw_memory_private.hpp
4  *
5  * Copyright 2016 by Intel.
6  *
7  * Contact: kevin.rogovin@gmail.com
8  *
9  * This Source Code Form is subject to the
10  * terms of the Mozilla Public License, v. 2.0.
11  * If a copy of the MPL was not distributed with
12  * this file, You can obtain one at
13  * http://mozilla.org/MPL/2.0/.
14  *
15  * \author Kevin Rogovin <kevin.rogovin@gmail.com>
16  *
17  */
18 
19 
20 /* Private functions needed for macros in fastuidraw_memory.hpp
21  */
22 
23 #ifndef FASTUIDRAW_FASTUIDRAW_MEMORY_PRIVATE_HPP
24 #define FASTUIDRAW_FASTUIDRAW_MEMORY_PRIVATE_HPP
25 
26 #include <cstddef>
27 
28 /*!
29  * Internal routine used by FASTUIDRAWnew, do not use directly.
30  */
31 void*
32 operator new(std::size_t n, const char *file, int line) throw ();
33 
34 /*!
35  * Internal routine used by FASTUIDRAWnew, do not use directly.
36  */
37 void*
38 operator new[](std::size_t n, const char *file, int line) throw ();
39 
40 /*!
41  * Internal routine used by FASTUIDRAWnew, do not use directly.
42  */
43 void
44 operator delete(void *ptr, const char *file, int line) throw();
45 
46 /*!
47  * Internal routine used by FASTUIDRAWnew, do not use directly.
48  */
49 void
50 operator delete[](void *ptr, const char *file, int line) throw();
51 
52 namespace fastuidraw
53 {
54 
55 namespace memory
56 {
57  /*!
58  * Private function used by macro FASTUIDRAWdelete, do NOT call.
59  */
60  void
61  check_object_exists(const void *ptr, const char *file, int line);
62 
63  /*!
64  * Private function used by macro FASTUIDRAWdelete, do NOT call.
65  */
66  template<typename T>
67  void
68  call_dtor(T *p)
69  {
70  p->~T();
71  }
72 
73  /*!
74  * Private function used by macro FASTUIDRAWmalloc, do NOT call.
75  */
76  void*
77  malloc_implement(size_t size, const char *file, int line);
78 
79  /*!
80  * Private function used by macro FASTUIDRAWcalloc, do NOT call.
81  */
82  void*
83  calloc_implement(size_t nmemb, size_t size, const char *file, int line);
84 
85  /*!
86  * Private function used by macro FASTUIDRAWrealloc, do NOT call.
87  */
88  void*
89  realloc_implement(void *ptr, size_t size, const char *file, int line);
90 
91  /*!
92  * Private function used by macro FASTUIDRAWfree, do NOT call.
93  */
94  void
95  free_implement(void *ptr, const char *file, int line);
96 
97 } //namespace memory
98 
99 } //namespace fastuidraw
100 
101 #endif
void free_implement(void *ptr, const char *file, int line)
all classes and functions of FastUIDraw are in the namespace fastuidraw.
Definition: colorstop.hpp:28
void * malloc_implement(size_t size, const char *file, int line)
void check_object_exists(const void *ptr, const char *file, int line)
void * realloc_implement(void *ptr, size_t size, const char *file, int line)
void * calloc_implement(size_t nmemb, size_t size, const char *file, int line)