diff options
author | Martin Kroeker <martin@ruby.chemie.uni-freiburg.de> | 2017-07-11 18:42:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-11 18:42:39 +0200 |
commit | 731c518cffedbbedb17d55850dd5506672e1f6a4 (patch) | |
tree | 9ffd898d3e02382e817e7779bab1e8c72093b4c2 | |
parent | 29fc429d9a34a513e737df287c8a8785c9f7a332 (diff) | |
download | openblas-731c518cffedbbedb17d55850dd5506672e1f6a4.tar.gz openblas-731c518cffedbbedb17d55850dd5506672e1f6a4.tar.bz2 openblas-731c518cffedbbedb17d55850dd5506672e1f6a4.zip |
Add files via upload
-rw-r--r-- | driver/others/memory.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/driver/others/memory.c b/driver/others/memory.c index 103c97077..38d063715 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -1052,7 +1052,7 @@ void *blas_memory_alloc(int procpos){ mypos = WhereAmI(); position = mypos; - while (position > NUM_BUFFERS) position >>= 1; + while (position >= NUM_BUFFERS) position >>= 1; do { if (!memory[position].used && (memory[position].pos == mypos)) { @@ -1201,8 +1201,8 @@ void blas_memory_free(void *free_area){ position = 0; LOCK_COMMAND(&alloc_lock); - while ((memory[position].addr != free_area) - && (position < NUM_BUFFERS)) position++; + while ((position < NUM_BUFFERS) && (memory[position].addr != free_area)) + position++; if (memory[position].addr != free_area) goto error; @@ -1516,12 +1516,30 @@ static int on_process_term(void) #else #pragma comment(linker, "/INCLUDE:__tls_used") #endif -#pragma data_seg(push, old_seg) + +#ifdef _WIN64 +#pragma const_seg(".CRT$XLB") +#else #pragma data_seg(".CRT$XLB") +#endif static void (APIENTRY *dll_callback)(HINSTANCE h, DWORD ul_reason_for_call, PVOID pv) = DllMain; +#ifdef _WIN64 +#pragma const_seg() +#else +#pragma data_seg() +#endif + +#ifdef _WIN64 +#pragma const_seg(".CRT$XTU") +#else #pragma data_seg(".CRT$XTU") +#endif static int(*p_process_term)(void) = on_process_term; -#pragma data_seg(pop, old_seg) +#ifdef _WIN64 +#pragma const_seg() +#else +#pragma data_seg() +#endif #endif #if (defined(C_PGI) || (!defined(C_SUN) && defined(F_INTERFACE_SUN))) && (defined(ARCH_X86) || defined(ARCH_X86_64)) |