1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
memalign is Linux-specific, so use C11 aligned_alloc instead
In file included from media_driver/agnostic/common/os/mos_utilities.c:36:
/usr/include/malloc.h:3:2: error: "<malloc.h> has been replaced by <stdlib.h>"
#error "<malloc.h> has been replaced by <stdlib.h>"
^
media_driver/agnostic/common/os/mos_utilities.c:3096:11: error: use of undeclared identifier 'memalign'
ptr = _aligned_malloc(size, alignment);
^
media_driver/linux/common/os/mos_utilities_specific.h:91:43: note: expanded from macro '_aligned_malloc'
#define _aligned_malloc(size, alignment) memalign(alignment, size)
^
--- media_driver/agnostic/common/os/mos_utilities.c.orig 2018-10-01 21:39:52 UTC
+++ media_driver/agnostic/common/os/mos_utilities.c
@@ -33,7 +33,6 @@
#endif
#include <fcntl.h> //open
-#include <malloc.h> // For memalign
#include <string.h> // memset
#include <stdlib.h> // atoi atol
#include <math.h>
--- media_driver/agnostic/ult/cm/buffer_up_test.cpp.orig 2018-10-01 21:39:52 UTC
+++ media_driver/agnostic/ult/cm/buffer_up_test.cpp
@@ -21,7 +21,6 @@
*/
#include "cm_test.h"
-#include <malloc.h>
class BufferUPTest: public CmTest
{
--- media_driver/linux/common/os/mos_utilities_specific.h.orig 2018-10-01 21:39:52 UTC
+++ media_driver/linux/common/os/mos_utilities_specific.h
@@ -88,7 +88,7 @@
#define UFINT_PATH_LINUX "UFINT"
#define UFEXT_PATH_LINUX "UFEXT"
-#define _aligned_malloc(size, alignment) memalign(alignment, size)
+#define _aligned_malloc(size, alignment) aligned_alloc(alignment, size)
#define _aligned_free(ptr) free(ptr)
#define __MOS_USER_FEATURE_KEY_MESSAGE_DEFAULT_VALUE_STR "1"
--- media_driver/linux/ult/ult_app/cm/cm_test.h.orig 2018-10-01 21:39:52 UTC
+++ media_driver/linux/ult/ult_app/cm/cm_test.h
@@ -23,7 +23,6 @@
#ifndef MEDIADRIVER_LINUX_CODECHAL_ULT_ULTAPP_CMTEST_H_
#define MEDIADRIVER_LINUX_CODECHAL_ULT_ULTAPP_CMTEST_H_
-#include <malloc.h>
#include "gtest/gtest.h"
#include "mock_device.h"
#include "../memory_leak_detector.h"
@@ -34,7 +33,7 @@ class CmTest: public testing::Test
{
public:
static void* AllocateAlignedMemory(size_t size, size_t alignment)
- { return memalign(alignment, size); }
+ { return aligned_alloc(alignment, size); }
static void FreeAlignedMemory(void *memory) { free(memory); }
|