]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.1.0/test_and_benchmark/libtest/src/libtest_porting_abstraction_layer/libtest_porting_abstraction_layer_free.c
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.1.0 / test_and_benchmark / libtest / src / libtest_porting_abstraction_layer / libtest_porting_abstraction_layer_free.c
1 /***** includes *****/
2 #include "libtest_porting_abstraction_layer_internal.h"
3
4 /* TRD : libtest_pal_malloc() and libtest_pal_free() are used for and only for
5          one queue_umm test
6
7          if either is not implemented, the test will not run
8
9          that's the only impact of their presence or absence
10 */
11
12
13
14
15
16 /****************************************************************************/
17 #if( defined _MSC_VER )
18   /* TRD : MSVC compiler
19
20            an unfortunately necessary hack for MSVC
21            MSVC only defines __STDC__ if /Za is given, where /Za turns off MSVC C extensions - 
22            which prevents Windows header files from compiling.
23   */
24
25   #define __STDC__         1
26   #define __STDC_HOSTED__  1
27 #endif
28
29
30
31
32
33 /****************************************************************************/
34 #if( defined __STDC__ && defined __STDC_HOSTED__ && __STDC_HOSTED__ == 1 && !defined KERNEL_MODE )
35
36   #ifdef LIBTEST_PAL_FREE
37     #error More than one porting abstraction layer matches the current platform in "libtest_porting_abstraction_layer_free.c".
38   #endif
39
40   #define LIBTEST_PAL_FREE
41
42   void libtest_pal_free( void *memory )
43   {
44     LFDS710_PAL_ASSERT( memory != NULL );
45
46     free( memory );
47
48     return;
49   }
50
51 #endif
52
53
54
55
56
57 /****************************************************************************/
58 #if( defined _WIN32 && defined KERNEL_MODE )
59
60   #ifdef LIBTEST_PAL_FREE
61     #error More than one porting abstraction layer matches the current platform in "libtest_porting_abstraction_layer_free.c".
62   #endif
63
64   #define LIBTEST_PAL_FREE
65
66   void libtest_pal_free( void *memory )
67   {
68     LFDS710_PAL_ASSERT( memory != NULL );
69
70     ExFreePoolWithTag( memory, 'sdfl' );
71
72     return;
73   }
74
75 #endif
76
77
78
79
80
81 /****************************************************************************/
82 #if( defined __linux__ && defined KERNEL_MODE )
83
84   #ifdef LIBTEST_PAL_FREE
85     #error More than one porting abstraction layer matches the current platform in "libtest_porting_abstraction_layer_free.c".
86   #endif
87
88   #define LIBTEST_PAL_FREE
89
90   void libtest_pal_free( void *memory )
91   {
92     LFDS710_PAL_ASSERT( memory != NULL );
93
94     vfree( memory );
95
96     return;
97   }
98
99 #endif
100
101
102
103
104
105 /****************************************************************************/
106 #if( !defined LIBTEST_PAL_FREE )
107
108   void libtest_pal_free( void *memory )
109   {
110     LFDS710_PAL_ASSERT( memory != NULL );
111
112     return;
113   }
114
115 #endif
116