diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-08-14 15:44:23 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-08-14 15:44:23 +0400 |
commit | ef23b0a6a48e88b606d3548bb86520ceec563f40 (patch) | |
tree | d9791de4f5c25ba581a3fb6c7704bbc108458a8b /winsup | |
parent | 111ced6d60d333666d32f53546a79d9a42c2d4ee (diff) |
* include/sys/cygwin.h (struct per_process): Add posix_memalign. Reduce
size of unused2 accordingly.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Initialize
u->posix_memalign with address of posix_memalign.
* malloc_wrapper.cc (posix_memalign): Call user-provided posix_memalign
rather than just returning ENOSYS.
* globals.cc (__cygwin_user_data): Initialize posix_memalign member.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 11 | ||||
-rw-r--r-- | winsup/cygwin/globals.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/cygwin.h | 7 | ||||
-rw-r--r-- | winsup/cygwin/lib/_cygwin_crt0_common.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/malloc_wrapper.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/release/1.7.24 | 13 |
7 files changed, 34 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 185a19612..19abf2ebe 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,14 @@ +2013-08-14 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h (struct per_process): Add posix_memalign. Reduce + size of unused2 accordingly. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Initialize + u->posix_memalign with address of posix_memalign. + * malloc_wrapper.cc (posix_memalign): Call user-provided posix_memalign + rather than just returning ENOSYS. + * globals.cc (__cygwin_user_data): Initialize posix_memalign member. + 2013-08-09 Corinna Vinschen <corinna@vinschen.de> * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 24. diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc index a39d5c908..fa32749ba 100644 --- a/winsup/cygwin/globals.cc +++ b/winsup/cygwin/globals.cc @@ -194,6 +194,7 @@ extern "C" { /* api_major */ 0, /* api_minor */ 0, /* unused2 */ {}, + /* posix_memalign */ posix_memalign, /* pseudo_reloc_start */ NULL, /* pseudo_reloc_end */ NULL, /* image_base */ NULL, diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index dfb171e2f..6681a9955 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -438,12 +438,13 @@ details. */ arc4random_stir, arc4random_uniform. 267: Export rawmemchr. 268: Export GetCommandLineA, GetCommandLineW + 269: Allow application override of posix_memalign. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 268 +#define CYGWIN_VERSION_API_MINOR 269 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h index 354d0eb4c..ca2f92996 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -304,10 +304,13 @@ struct per_process /* For future expansion, so apps won't have to be relinked if we add an item. */ #ifdef __x86_64__ - DWORD_PTR unused2[5]; + DWORD_PTR unused2[4]; #else - DWORD_PTR unused2[3]; + DWORD_PTR unused2[2]; #endif + + int (*posix_memalign)(void **, size_t, size_t); + void *pseudo_reloc_start; void *pseudo_reloc_end; void *image_base; diff --git a/winsup/cygwin/lib/_cygwin_crt0_common.cc b/winsup/cygwin/lib/_cygwin_crt0_common.cc index b22859ec0..718ce941e 100644 --- a/winsup/cygwin/lib/_cygwin_crt0_common.cc +++ b/winsup/cygwin/lib/_cygwin_crt0_common.cc @@ -145,6 +145,7 @@ _cygwin_crt0_common (MainFunc f, per_process *u) u->free = &free; u->realloc = &realloc; u->calloc = &calloc; + u->posix_memalign = &posix_memalign; /* Likewise for the C++ memory operators, if any, but not if we were dlopen()'d, as we might get dlclose()'d and that would diff --git a/winsup/cygwin/malloc_wrapper.cc b/winsup/cygwin/malloc_wrapper.cc index c5271588f..17347ae3d 100644 --- a/winsup/cygwin/malloc_wrapper.cc +++ b/winsup/cygwin/malloc_wrapper.cc @@ -115,7 +115,7 @@ posix_memalign (void **memptr, size_t alignment, size_t bytes) void *res; if (!use_internal) - return ENOSYS; + return user_data->posix_memalign (memptr, alignment, bytes); if ((alignment & (alignment - 1)) != 0) return EINVAL; __malloc_lock (); diff --git a/winsup/cygwin/release/1.7.24 b/winsup/cygwin/release/1.7.24 new file mode 100644 index 000000000..b24a7b079 --- /dev/null +++ b/winsup/cygwin/release/1.7.24 @@ -0,0 +1,13 @@ +What's new: +----------- + +- Allow application override of posix_memalign. + + +What changed: +------------- + + +Bug fixes: +---------- + |