Removing xenia/malloc.*

Using standard memory functions now.
This commit is contained in:
Ben Vanik
2014-08-20 22:22:47 -07:00
parent 609d7c755f
commit cecf83b7b7
36 changed files with 266 additions and 481 deletions

View File

@@ -408,7 +408,7 @@ SHIM_CALL _vswprintf_shim(PPCContext* ppc_state, KernelState* state) {
// swap the format buffer
wchar_t* swapped_format =
(wchar_t*)xe_malloc((format_length + 1) * sizeof(wchar_t));
(wchar_t*)malloc((format_length + 1) * sizeof(wchar_t));
for (size_t i = 0; i < format_length; ++i) {
swapped_format[i] = poly::byte_swap(format[i]);
}
@@ -587,13 +587,13 @@ SHIM_CALL _vswprintf_shim(PPCContext* ppc_state, KernelState* state) {
const wchar_t* data = (const wchar_t*)SHIM_MEM_ADDR(value);
size_t data_length = wcslen(data);
wchar_t* swapped_data =
(wchar_t*)xe_malloc((data_length + 1) * sizeof(wchar_t));
(wchar_t*)malloc((data_length + 1) * sizeof(wchar_t));
for (size_t i = 0; i < data_length; ++i) {
swapped_data[i] = poly::byte_swap(data[i]);
}
swapped_data[data_length] = '\0';
int result = wsprintf(b, local, swapped_data);
xe_free(swapped_data);
free(swapped_data);
b += result;
arg_index++;
} else {
@@ -607,7 +607,7 @@ SHIM_CALL _vswprintf_shim(PPCContext* ppc_state, KernelState* state) {
}
*b = '\0';
xe_free(swapped_format);
free(swapped_format);
// swap the result buffer
for (wchar_t* swap = buffer; swap != b; ++swap) {