OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.4 KiB

  1. From bab47fac06af5d891caaccac99f1dc1e75bdc219 Mon Sep 17 00:00:00 2001
  2. From: Szabolcs Nagy <nsz@port70.net>
  3. Date: Sat, 1 Aug 2015 23:24:07 +0000
  4. Subject: [PATCH 2/6] posix_memalign
  5. ---
  6. gcc/config/i386/pmm_malloc.h | 9 +++++----
  7. 1 file changed, 5 insertions(+), 4 deletions(-)
  8. diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
  9. index a1f98d3..4f6b2dc 100644
  10. --- a/gcc/config/i386/pmm_malloc.h
  11. +++ b/gcc/config/i386/pmm_malloc.h
  12. @@ -27,12 +27,13 @@
  13. #include <stdlib.h>
  14. /* We can't depend on <stdlib.h> since the prototype of posix_memalign
  15. - may not be visible. */
  16. + may not be visible and we can't pollute the namespace either. */
  17. #ifndef __cplusplus
  18. -extern int posix_memalign (void **, size_t, size_t);
  19. +extern int _mm_posix_memalign (void **, size_t, size_t)
  20. #else
  21. -extern "C" int posix_memalign (void **, size_t, size_t) throw ();
  22. +extern "C" int _mm_posix_memalign (void **, size_t, size_t) throw ()
  23. #endif
  24. +__asm__("posix_memalign");
  25. static __inline void *
  26. _mm_malloc (size_t size, size_t alignment)
  27. @@ -42,7 +43,7 @@ _mm_malloc (size_t size, size_t alignment)
  28. return malloc (size);
  29. if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4))
  30. alignment = sizeof (void *);
  31. - if (posix_memalign (&ptr, alignment, size) == 0)
  32. + if (_mm_posix_memalign (&ptr, alignment, size) == 0)
  33. return ptr;
  34. else
  35. return NULL;
  36. --
  37. 2.8.1