File tree 2 files changed +10
-13
lines changed
2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 37
37
38
38
#ifndef PBRT_CORE_MEMORY_H
39
39
#define PBRT_CORE_MEMORY_H
40
- // #include "stdafx.h"
41
- #include < cstdint>
42
- #include < malloc.h>
40
+
43
41
#define PBRT_L1_CACHE_LINE_SIZE 64
44
42
45
- // core/memory.h*
46
- // #include "pbrt.h"
47
- // #include "parallel.h"
43
+ # include < stdint.h >
44
+ #include < stdlib.h >
45
+ #include < algorithm >
48
46
#include < list>
47
+ #include < utility>
49
48
50
49
// Memory Declarations
51
50
#define ARENA_ALLOC (arena, Type ) new ((arena).Alloc(sizeof (Type))) Type
Original file line number Diff line number Diff line change 30
30
31
31
*/
32
32
33
- // #include "stdafx.h"
34
-
35
- // core/memory.cpp*
33
+ #include < cstdlib>
36
34
#include " utils/pspRTmem.h"
37
35
38
36
// Memory Allocation Functions
39
37
void *AllocAligned (size_t size)
40
38
{
41
39
#if defined(PBRT_IS_WINDOWS)
42
40
return _aligned_malloc (size, PBRT_L1_CACHE_LINE_SIZE);
43
- #elif defined(PBRT_IS_OPENBSD) || defined(PBRT_IS_OSX)
41
+ #else
44
42
void *ptr;
45
- if (posix_memalign (&ptr, PBRT_L1_CACHE_LINE_SIZE, size) != 0 ) ptr = nullptr ;
43
+ if (posix_memalign (&ptr, PBRT_L1_CACHE_LINE_SIZE, size) != 0 ) {
44
+ ptr = nullptr ;
45
+ }
46
46
return ptr;
47
- #else
48
- return memalign (PBRT_L1_CACHE_LINE_SIZE, size);
49
47
#endif
50
48
}
51
49
You can’t perform that action at this time.
0 commit comments