mm_malloc.h (218893) | mm_malloc.h (221345) |
---|---|
1/*===---- mm_malloc.h - Allocating and Freeing Aligned Memory Blocks -------=== 2 * 3 * Permission is hereby granted, free of charge, to any person obtaining a copy 4 * of this software and associated documentation files (the "Software"), to deal 5 * in the Software without restriction, including without limitation the rights 6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 * copies of the Software, and to permit persons to whom the Software is 8 * furnished to do so, subject to the following conditions: --- 26 unchanged lines hidden (view full) --- 35// Some systems (e.g. those with GNU libc) declare posix_memalign with an 36// exception specifier. Via an "egregious workaround" in 37// Sema::CheckEquivalentExceptionSpec, Clang accepts the following as a valid 38// redeclaration of glibc's declaration. 39extern "C" int posix_memalign(void **memptr, size_t alignment, size_t size); 40#endif 41#endif 42 | 1/*===---- mm_malloc.h - Allocating and Freeing Aligned Memory Blocks -------=== 2 * 3 * Permission is hereby granted, free of charge, to any person obtaining a copy 4 * of this software and associated documentation files (the "Software"), to deal 5 * in the Software without restriction, including without limitation the rights 6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 * copies of the Software, and to permit persons to whom the Software is 8 * furnished to do so, subject to the following conditions: --- 26 unchanged lines hidden (view full) --- 35// Some systems (e.g. those with GNU libc) declare posix_memalign with an 36// exception specifier. Via an "egregious workaround" in 37// Sema::CheckEquivalentExceptionSpec, Clang accepts the following as a valid 38// redeclaration of glibc's declaration. 39extern "C" int posix_memalign(void **memptr, size_t alignment, size_t size); 40#endif 41#endif 42 |
43#if !(defined(_WIN32) && defined(_mm_malloc)) |
|
43static __inline__ void *__attribute__((__always_inline__, __nodebug__, 44 __malloc__)) 45_mm_malloc(size_t size, size_t align) 46{ 47 if (align == 1) { 48 return malloc(size); 49 } 50 --- 11 unchanged lines hidden (view full) --- 62 return mallocedMemory; 63} 64 65static __inline__ void __attribute__((__always_inline__, __nodebug__)) 66_mm_free(void *p) 67{ 68 free(p); 69} | 44static __inline__ void *__attribute__((__always_inline__, __nodebug__, 45 __malloc__)) 46_mm_malloc(size_t size, size_t align) 47{ 48 if (align == 1) { 49 return malloc(size); 50 } 51 --- 11 unchanged lines hidden (view full) --- 63 return mallocedMemory; 64} 65 66static __inline__ void __attribute__((__always_inline__, __nodebug__)) 67_mm_free(void *p) 68{ 69 free(p); 70} |
71#endif |
|
70 71#endif /* __MM_MALLOC_H */ | 72 73#endif /* __MM_MALLOC_H */ |