We are so messy with this. We should stop checking for platforms and 
start checking for features.

This should have always been a "HAS_MEMMAP", not "__linux__" or all of 
those messy things.

--
Tom.


On 21/08/14 11:05, Jean Guyomarc'h wrote:
> cedric pushed a commit to branch master.
>
> http://git.enlightenment.org/core/efl.git/commit/?id=dc8e006e4f2bd7d8de6d1f9776539764ef1263bd
>
> commit dc8e006e4f2bd7d8de6d1f9776539764ef1263bd
> Author: Jean Guyomarc'h <jean.guyoma...@gmail.com>
> Date:   Thu Aug 21 11:27:14 2014 +0200
>
>      eo: mmap()/unmap() are also supported on OSX
>
>      Reviewers: raster, raoulh
>      @feature
>
>      Subscribers: cedric
>
>      Differential Revision: https://phab.enlightenment.org/D1240
>
>      Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
> ---
>   src/lib/eo/eo.c                 | 8 ++++----
>   src/lib/eo/eo_ptr_indirection.x | 8 ++++----
>   2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
> index b5aaadf..187b240 100644
> --- a/src/lib/eo/eo.c
> +++ b/src/lib/eo/eo.c
> @@ -289,7 +289,7 @@ typedef struct _Eo_Call_Stack {
>   static void *
>   _eo_call_stack_mem_alloc(size_t maxsize)
>   {
> -#ifdef __linux__
> +#if defined (__linux__) || defined (__MacOSX__)
>      // allocate eo call stack via mmped anon segment if on linux - more
>      // secure and safe. also gives page aligned memory allowing madvise
>      void *ptr;
> @@ -307,10 +307,10 @@ _eo_call_stack_mem_alloc(size_t maxsize)
>   #else
>      //in regular cases just use malloc
>      return calloc(1, maxsize);
> -#endif
> +#endif
>   }
>
> -#ifdef __linux__
> +#if defined (__linux__) || defined (__MacOSX__)
>   static void
>   _eo_call_stack_mem_resize(void **ptr EINA_UNUSED, size_t newsize, size_t 
> maxsize)
>   {
> @@ -331,7 +331,7 @@ _eo_call_stack_mem_resize(void **ptr EINA_UNUSED, size_t 
> newsize EINA_UNUSED, si
>   #endif
>   }
>
> -#ifdef __linux__
> +#if defined (__linux__) || defined (__MacOSX__)
>   static void
>   _eo_call_stack_mem_free(void *ptr, size_t maxsize)
>   {
> diff --git a/src/lib/eo/eo_ptr_indirection.x b/src/lib/eo/eo_ptr_indirection.x
> index 4efe667..5bba62d 100644
> --- a/src/lib/eo/eo_ptr_indirection.x
> +++ b/src/lib/eo/eo_ptr_indirection.x
> @@ -1,5 +1,5 @@
>   #include <assert.h>
> -#ifdef __linux__
> +#if defined (__linux__) || defined (__MacOSX__)
>   #include <sys/types.h>
>   #include <sys/stat.h>
>   #include <fcntl.h>
> @@ -119,7 +119,7 @@ typedef struct _Mem_Header
>   static void *
>   _eo_id_mem_alloc(size_t size)
>   {
> -#ifdef __linux__
> +#if defined (__linux__) || defined (__MacOSX__)
>      void *ptr;
>      Mem_Header *hdr;
>      size_t newsize;
> @@ -154,7 +154,7 @@ _eo_id_mem_calloc(size_t num, size_t size)
>   static void
>   _eo_id_mem_free(void *ptr)
>   {
> -#ifdef __linux__
> +#if defined (__linux__) || defined (__MacOSX__)
>      Mem_Header *hdr;
>      if (!ptr) return;
>      hdr = (Mem_Header *)(((unsigned char *)ptr) - MEM_HEADER_SIZE);
> @@ -173,7 +173,7 @@ _eo_id_mem_free(void *ptr)
>   static void
>   _eo_id_mem_protect(void *ptr, Eina_Bool may_not_write)
>   {
> -# ifdef __linux__
> +# if defined (__linux__) || defined (__MacOSX__)
>      Mem_Header *hdr;
>      if (!ptr) return;
>      hdr = (Mem_Header *)(((unsigned char *)ptr) - MEM_HEADER_SIZE);
>



------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to