mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-08-24 16:24:47 +03:00
Fix whitespace
This mostly deletes trailing spaces. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
ddc9841019
commit
745a34f475
66 changed files with 760 additions and 769 deletions
|
@ -106,7 +106,7 @@ void _mi_options_init(void) {
|
|||
for(int i = 0; i < _mi_option_last; i++ ) {
|
||||
mi_option_t option = (mi_option_t)i;
|
||||
long l = mi_option_get(option); MI_UNUSED(l); // initialize
|
||||
// if (option != mi_option_verbose)
|
||||
// if (option != mi_option_verbose)
|
||||
{
|
||||
mi_option_desc_t* desc = &options[option];
|
||||
_mi_verbose_message("option '%s': %ld\n", desc->name, desc->value);
|
||||
|
@ -177,7 +177,7 @@ static void mi_cdecl mi_out_stderr(const char* msg, void* arg) {
|
|||
#ifdef _WIN32
|
||||
// on windows with redirection, the C runtime cannot handle locale dependent output
|
||||
// after the main thread closes so we use direct console output.
|
||||
if (!_mi_preloading()) {
|
||||
if (!_mi_preloading()) {
|
||||
// _cputs(msg); // _cputs cannot be used at is aborts if it fails to lock the console
|
||||
static HANDLE hcon = INVALID_HANDLE_VALUE;
|
||||
if (hcon == INVALID_HANDLE_VALUE) {
|
||||
|
@ -281,7 +281,7 @@ static _Atomic(size_t) warning_count; // = 0; // when >= max_warning_count stop
|
|||
// inside the C runtime causes another message.
|
||||
// In some cases (like on macOS) the loader already allocates which
|
||||
// calls into mimalloc; if we then access thread locals (like `recurse`)
|
||||
// this may crash as the access may call _tlv_bootstrap that tries to
|
||||
// this may crash as the access may call _tlv_bootstrap that tries to
|
||||
// (recursively) invoke malloc again to allocate space for the thread local
|
||||
// variables on demand. This is why we use a _mi_preloading test on such
|
||||
// platforms. However, C code generator may move the initial thread local address
|
||||
|
@ -407,7 +407,7 @@ static _Atomic(void*) mi_error_arg; // = NULL
|
|||
|
||||
static void mi_error_default(int err) {
|
||||
MI_UNUSED(err);
|
||||
#if (MI_DEBUG>0)
|
||||
#if (MI_DEBUG>0)
|
||||
if (err==EFAULT) {
|
||||
#ifdef _MSC_VER
|
||||
__debugbreak();
|
||||
|
@ -500,23 +500,23 @@ static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
|||
return (len > 0 && len < result_size);
|
||||
}
|
||||
#elif !defined(MI_USE_ENVIRON) || (MI_USE_ENVIRON!=0)
|
||||
// On Posix systemsr use `environ` to acces environment variables
|
||||
// On Posix systemsr use `environ` to acces environment variables
|
||||
// even before the C runtime is initialized.
|
||||
#if defined(__APPLE__) && defined(__has_include) && __has_include(<crt_externs.h>)
|
||||
#include <crt_externs.h>
|
||||
static char** mi_get_environ(void) {
|
||||
return (*_NSGetEnviron());
|
||||
}
|
||||
#else
|
||||
#else
|
||||
extern char** environ;
|
||||
static char** mi_get_environ(void) {
|
||||
return environ;
|
||||
}
|
||||
#endif
|
||||
static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
||||
if (name==NULL) return false;
|
||||
if (name==NULL) return false;
|
||||
const size_t len = strlen(name);
|
||||
if (len == 0) return false;
|
||||
if (len == 0) return false;
|
||||
char** env = mi_get_environ();
|
||||
if (env == NULL) return false;
|
||||
// compare up to 256 entries
|
||||
|
@ -530,7 +530,7 @@ static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
#else
|
||||
// fallback: use standard C `getenv` but this cannot be used while initializing the C runtime
|
||||
static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
||||
// cannot call getenv() when still initializing the C runtime.
|
||||
|
@ -558,7 +558,7 @@ static bool mi_getenv(const char* name, char* result, size_t result_size) {
|
|||
#endif // !MI_USE_ENVIRON
|
||||
#endif // !MI_NO_GETENV
|
||||
|
||||
static void mi_option_init(mi_option_desc_t* desc) {
|
||||
static void mi_option_init(mi_option_desc_t* desc) {
|
||||
// Read option value from the environment
|
||||
char buf[64+1];
|
||||
mi_strlcpy(buf, "mimalloc_", sizeof(buf));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue