diff options
author | ruslantproductengine <ruslantproductengine@lindenlab.com> | 2015-04-27 18:21:39 +0300 |
---|---|---|
committer | ruslantproductengine <ruslantproductengine@lindenlab.com> | 2015-04-27 18:21:39 +0300 |
commit | 75ffe90b0cf14559543e1719bf48fd0b397f3905 (patch) | |
tree | dbe5731318323d961eb30e508d14bc744ae001f3 /indra/llcommon | |
parent | 348bfc7ea3e1014b94dbcd29744e636e805d44cb (diff) |
MAINT-5042 FIXED SL Viewer Closes Unexpectedly in specific area with high RenderVolumeLODFactor
- fix for review
- fix in buffer overrun detector
Diffstat (limited to 'indra/llcommon')
-rwxr-xr-x | indra/llcommon/llmemory.cpp | 3 | ||||
-rwxr-xr-x | indra/llcommon/llmemory.h | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index ae11988df8..3a8eabac09 100755 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -2176,8 +2176,7 @@ void* ll_aligned_malloc_fallback( size_t size, int align ) SYSTEM_INFO sysinfo; GetSystemInfo(&sysinfo); - unsigned int for_alloc = sysinfo.dwPageSize; - while(for_alloc < size) for_alloc += sysinfo.dwPageSize; + unsigned int for_alloc = (size/sysinfo.dwPageSize + !!(size%sysinfo.dwPageSize)) * sysinfo.dwPageSize; void *p = VirtualAlloc(NULL, for_alloc+sysinfo.dwPageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); if(NULL == p) { diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index c4c9cc0566..fd09eb9deb 100755 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -97,7 +97,7 @@ template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) //------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------ // for enable buffer overrun detection predefine LL_DEBUG_BUFFER_OVERRUN in current library - // change preprocessro code to: #if 1 && defined(LL_WINDOWS) + // change preprocessor code to: #if 1 && defined(LL_WINDOWS) #if 0 && defined(LL_WINDOWS) void* ll_aligned_malloc_fallback( size_t size, int align ); |