Out-of-bounds memory is no longer accessed if the realloc size is larger.
If reallocation fails, the old memory will not be freed and a memcpy
will not take place.
This should match the Windows _aligned_realloc behaviour, except that an
extra parameter is used.
All refer to memcpy, and only memcpy_fast is used, so there's no point
keeping them.
Also remove the _memset16_unaligned function prototype since there's no
function definition for it.
The code was restoring the defaults with hardcoded values. This patch
restores the values however they're defined as defaults for AppConfig.
The code still uses hardcode values to set the highlights (bold) of the
default radio button text - using SetDefaultItem.
Note that other than these two panels, the speedhacks panel is the only other
which has a restore-defaults button, and it already does so programatically.
It's probably not worth trying to unify these three restore-defaults button
into a single system.
The dialog event handling is a bit messed up. An ok/cancel event sends a
close event, which sends a cancel event and repeats. This would actually
be an infinite loop if wxWidgets didn't detect a loop.
Rework the event handling to avoid the loop and to remember the
positions of modal dialogs as well.
Gregory: Get all changes but keep C11 code path which will be the future
(if someone can find info on Visual Studio support)
* Keep the old posix api to use address sanitizer on gcc 4.9
Conflicts:
common/build/Utilities/utilities.vcxproj.filters
common/build/Utilities/utilities_vs2012.vcxproj.filters
common/build/Utilities/utilities_vs2013.vcxproj.filters
common/include/Utilities/MemcpyFast.h
common/include/Utilities/StringHelpers.h
common/src/Utilities/AlignedMalloc.cpp
common/src/Utilities/vssprintf.cpp
plugins/GSdx/stdafx.cpp
there was already code for this, but it was broken due to:
- the message is WM_SYSCOMMAND and wParam is SC_SCREENSAVE etc.
- GSPanel doesn't get WM_SYSCOMMAND - GSFrame does.
- also disabled screen saver while paused if not set to hide the GS window.
- it's an ugly hack where windows keeps trying to activate the screen saver
every few seconds but such code prevents it (Lilypad has the same hack).
the new code uses windows API which was designed for this.
the screen saver is now disabled while the window is focused and the emulation
is running. it's on by defauly and without GUI - the same as with normal games.
this patch addresses Windows only, but adds a placeholder for future
implementations for other platforms.
Performance is not important here. I'm not sure Windows could handle VLA
* new/delete can still be used otherwise.
* Put an assert(0) because debugger surely don't use string bigger than
128 bytes.
code is much more compact 20 lines vs 700 lines ...
It was done to avoid issue with specific compiler flags. I think it is safe to reenable it now.
There are some flags that are still disabled that potentially could be re-enabled:
-fno-guess-branch-probability
-fno-dse
-fno-tree-dse
But it will be for another PR
Call to vsnprintf update the gp_offset of the varargs (at least on x86_64 linux).
Therefore the 2nd call (because buffer was too small) uses out-of-memory arguments
We need to keep a local copy otherwise you will get an awful SIGSEV
Note: I'm sure we have same issue on plugins
After a Console.Write/Writeln that uses colors a call to
ConsoleColorScope::LeaveScope() is made to restore m_old_color. This
restoration command stays buffered until a full line is printed. In the
meantime any console message that happens will use the old coloring
and if the program happens to crash the console would keep using the
color of the last colored text that was printed.
builds an Utilies_NO_TLS.a archive of the common Utilities code. It replaces native TLS by a slower reimplementation
Rational: number of TLS slot is very limited by the GLIBc on linux. I hope it doesn't impact performance.
* Zzogl don't requires TLS AFAIK
* spu2x will likely use it for assertions only.
TLS exhaustion creates issue to dlopen plugins
issue #384 : https://github.com/PCSX2/pcsx2/issues/384
But also for profiled build (-fprofile-generate)
http://forums.pcsx2.net/Thread-WORKAROUND-build-with-fprofile-generate
If someone have a better idea, please raise your hand!
Possibly also changes the semantics. According to the docs, it should now be
equal to the Windows code (up to accuracy issues, of course).
v2: done by gregory38
Fix miscalculation of time. Unit must be in 1s/GetThreadTicksPerSeconds(). (now us)
Factorize a bit GetCpuTime/GetThreadCpuTime
Note: results seems reasonables and mostly equivalent as before.
* link common with c lib (required for gold linker)
* fix the macro to properly set the library variable
=> use the variable instead to hardcoded value