diff --git a/include/clasp/clbind/function.h b/include/clasp/clbind/function.h index 38f3c53e07..0650aae93a 100644 --- a/include/clasp/clbind/function.h +++ b/include/clasp/clbind/function.h @@ -107,7 +107,7 @@ class WRAPPER_VariadicFunction(), code) { + : GlobalSimpleFunBase_O(fdesc, core::ClaspXepFunction::make(), code), fptr(ptr) { this->validateCodePointer((void **)&this->fptr, sizeof(this->fptr)); }; diff --git a/include/clasp/core/backtrace.h b/include/clasp/core/backtrace.h index 33e2719659..4782d5aba0 100644 --- a/include/clasp/core/backtrace.h +++ b/include/clasp/core/backtrace.h @@ -32,11 +32,18 @@ DebuggerFrame_O : public General_O { DebuggerFrame_O(T_sp a_fname, T_sp a_return_address, T_sp a_sp, T_sp a_fd, T_sp a_closure, T_sp a_args, bool a_av, List_sp a_locals, T_sp a_lang, bool a_is_xep) - : fname(a_fname), return_address(a_return_address), - source_position(a_sp), function_description(a_fd), - closure(a_closure), args(a_args), args_available(a_av), - locals(a_locals), is_xep(a_is_xep), - lang(a_lang), up(nil()), down(nil()) + : fname(a_fname), + return_address(a_return_address), + source_position(a_sp), + function_description(a_fd), + closure(a_closure), + args(a_args), + args_available(a_av), + locals(a_locals), + lang(a_lang), + up(nil()), + down(nil()), + is_xep(a_is_xep) {} static DebuggerFrame_sp make(T_sp fname, T_sp ra, T_sp sp, T_sp fd, diff --git a/include/clasp/core/funcallableInstance.h b/include/clasp/core/funcallableInstance.h index 2ddd63c5c0..cde033dfce 100644 --- a/include/clasp/core/funcallableInstance.h +++ b/include/clasp/core/funcallableInstance.h @@ -63,7 +63,10 @@ class FuncallableInstance_O : public Function_O { explicit FuncallableInstance_O(GlobalSimpleFun_sp fdesc, Instance_sp metaClass, size_t slots) : Base(fdesc), _Class(metaClass), _RealFunction(nil()){}; FuncallableInstance_O(GlobalSimpleFun_sp fdesc, Instance_sp cl, Rack_sp rack) - : Base(fdesc), _Class(cl), _Rack(rack), _RealFunction(nil()){}; + : Base(fdesc), + _Rack(rack), + _Class(cl), + _RealFunction(nil()){}; virtual ~FuncallableInstance_O(){}; public: diff --git a/include/clasp/core/lisp.h b/include/clasp/core/lisp.h index 3d3eb9255a..800900725e 100644 --- a/include/clasp/core/lisp.h +++ b/include/clasp/core/lisp.h @@ -215,14 +215,14 @@ struct globals_t { mutable mp::SharedMutex _FinalizersMutex; mutable mp::SharedMutex _SourceFilesMutex; // Protect _SourceFileIndices mutable mp::SharedMutex _PackagesMutex; // Protect _PackageNameIndexMap - mutable mp::SharedMutex _ThePathnameTranslationsMutex; // Protect _ThePathnameTranslations - mutable mp::SharedMutex _JITLogMutex; // Protect _jit logging - mutable mp::SharedMutex _UnixSignalHandlersMutex; // Protect _UnixSignalHandlers - mutable mp::SharedMutex _CodeBlocksMutex; #ifdef DEBUG_MONITOR_SUPPORT mutable mp::SharedMutex _MonitorMutex; std::ofstream _MonitorStream; #endif + mutable mp::SharedMutex _ThePathnameTranslationsMutex; // Protect _ThePathnameTranslations + mutable mp::SharedMutex _JITLogMutex; // Protect _jit logging + mutable mp::SharedMutex _UnixSignalHandlersMutex; // Protect _UnixSignalHandlers + mutable mp::SharedMutex _CodeBlocksMutex; uint _StackWarnSize; uint _StackSampleCount; uint _StackSampleSize; @@ -257,9 +257,7 @@ struct globals_t { // ------------------------------------------------------------ // ------------------------------------------------------------ // ------------------------------------------------------------ - globals_t() : _MakePackageCallback(NULL), - _ExportSymbolCallback(NULL), - _PathMax(CLASP_MAXPATHLEN), + globals_t() : _ActiveThreadsMutex(ACTVTHRD_NAMEWORD), _DefaultSpecialBindingsMutex(SPCLBIND_NAMEWORD), _FinalizersMutex(MPSMESSG_NAMEWORD), @@ -279,7 +277,10 @@ struct globals_t { _ReplCounter(1), _Bundle(NULL), _DebugStream(NULL), - _SingleStepLevel(UndefinedUnsignedInt) + _SingleStepLevel(UndefinedUnsignedInt), + _MakePackageCallback(NULL), + _ExportSymbolCallback(NULL), + _PathMax(CLASP_MAXPATHLEN) { this->_GlobalInitializationCallbacks.clear(); this->_TraceLevel = 0; diff --git a/include/clasp/core/mpPackage.fwd.h b/include/clasp/core/mpPackage.fwd.h index 0fec7a91fc..667b38cbb4 100644 --- a/include/clasp/core/mpPackage.fwd.h +++ b/include/clasp/core/mpPackage.fwd.h @@ -141,7 +141,10 @@ class contention_free_shared_mutex { public: contention_free_shared_mutex() : - shared_locks_array_ptr(std::make_shared()), shared_locks_array(*shared_locks_array_ptr), want_x_lock(false), recursive_xlock_count(0), + want_x_lock(false), + shared_locks_array_ptr(std::make_shared()), + shared_locks_array(*shared_locks_array_ptr), + recursive_xlock_count(0), owner_thread_id(thread_id_t()) {} ~contention_free_shared_mutex() { diff --git a/include/clasp/core/mpPackage.h b/include/clasp/core/mpPackage.h index 5b06188d66..645468d85f 100644 --- a/include/clasp/core/mpPackage.h +++ b/include/clasp/core/mpPackage.h @@ -148,10 +148,21 @@ class Process_O : public core::CxxObject_O { #endif public: Process_O(core::T_sp name, core::T_sp function, core::List_sp arguments, core::List_sp initialSpecialBindings = nil(), - size_t stack_size = 8 * 1024 * 1024) - : _Parent(nil()), _UniqueID(global_process_UniqueID++), _Name(name), _Function(function), _Arguments(arguments), - _InitialSpecialBindings(initialSpecialBindings), _ThreadInfo(NULL), _ReturnValuesList(nil()), _Aborted(false), - _AbortCondition(nil()), _StackSize(stack_size), _Phase(Nascent), _SuspensionMutex(SUSPBARR_NAMEWORD) { + size_t stack_size = 8 * 1024 * 1024) : + _UniqueID(global_process_UniqueID++) + , _Parent(nil()) + , _Name(name) + , _Function(function) + , _Arguments(arguments) + , _InitialSpecialBindings(initialSpecialBindings) + , _ReturnValuesList(nil()) + , _Aborted(false) + , _AbortCondition(nil()) + , _ThreadInfo(NULL) + , _Phase(Nascent) + , _SuspensionMutex(SUSPBARR_NAMEWORD) + , _StackSize(stack_size) + { if (!function) { printf("%s:%d Trying to create a process and the function is NULL\n", __FILE__, __LINE__); } diff --git a/include/clasp/core/package.h b/include/clasp/core/package.h index fed3435f77..3469f19bb8 100644 --- a/include/clasp/core/package.h +++ b/include/clasp/core/package.h @@ -224,8 +224,12 @@ class Package_O : public General_O { public: // Not default constructable - Package_O() : _Nicknames(nil()), _LocalNicknames(nil()), - _Documentation(nil()), _Lock(PACKAGE__NAMEWORD), _ActsLikeKeywordPackage(false) + Package_O() : + _ActsLikeKeywordPackage(false), + _Nicknames(nil()), + _LocalNicknames(nil()), + _Documentation(nil()), + _Lock(PACKAGE__NAMEWORD) {}; virtual void fixupInternalsForSnapshotSaveLoad( snapshotSaveLoad::Fixup* fixup ) { diff --git a/include/clasp/core/translators.h b/include/clasp/core/translators.h index 7afde50f7c..195f516f34 100644 --- a/include/clasp/core/translators.h +++ b/include/clasp/core/translators.h @@ -285,7 +285,7 @@ template <> DeclareType _v; bool _val; - from_object( T_P o ) : _val( false ), _v( &_val ){}; + from_object( T_P o ) : _v( &_val ), _val(false) {}; }; template <> @@ -295,7 +295,7 @@ template <> DeclareType _v; bool _val; - from_object( T_P o ) : _val( false ), _v( &_val ){}; + from_object( T_P o ) : _v(&_val), _val( false ) {}; ~from_object() {/*non trivial*/}; }; @@ -306,7 +306,7 @@ template <> DeclareType _v; bool _val; - from_object( T_P o ) : _val( true ), _v( &_val ){}; + from_object( T_P o ) : _v(&_val), _val( true ) {}; }; // TO_OBJECT TRANSLATORS diff --git a/include/clasp/core/wrappers.h b/include/clasp/core/wrappers.h index f356a12f76..65c7b3214f 100644 --- a/include/clasp/core/wrappers.h +++ b/include/clasp/core/wrappers.h @@ -118,7 +118,10 @@ class WRAPPER_VariadicMethod : enum { NumParams = sizeof...(ARGS)+1 }; WRAPPER_VariadicMethod(MethodType ptr, core::FunctionDescription_sp fdesc, core::T_sp code) - : mptr(ptr), core::GlobalSimpleFunBase_O(fdesc,core::ClaspXepFunction::make(),code) { + : + core::GlobalSimpleFunBase_O(fdesc,core::ClaspXepFunction::make(),code), + mptr(ptr) + { this->validateCodePointer((void**)&this->mptr,sizeof(this->mptr)); }; @@ -190,7 +193,10 @@ class WRAPPER_VariadicMethod < RT(OT::*)(ARGS...) const, Policies, ArgumentWrapp enum { NumParams = sizeof...(ARGS)+1 }; WRAPPER_VariadicMethod(MethodType ptr, core::FunctionDescription_sp fdesc, core::T_sp code) - : mptr(ptr), core::GlobalSimpleFunBase_O(fdesc,core::ClaspXepFunction::make(),code) { + : + core::GlobalSimpleFunBase_O(fdesc,core::ClaspXepFunction::make(),code), + mptr(ptr) + { this->validateCodePointer((void**)&this->mptr,sizeof(this->mptr)); }; diff --git a/include/clasp/gctools/gcweak.h b/include/clasp/gctools/gcweak.h index 7559b4c802..9e526d004b 100644 --- a/include/clasp/gctools/gcweak.h +++ b/include/clasp/gctools/gcweak.h @@ -292,10 +292,10 @@ class WeakKeyHashTable { typedef gctools::GCBucketAllocator ValueBucketsAllocatorType; public: - core::Number_sp _RehashSize; - double _RehashThreshold; - size_t _Length; - gctools::tagged_pointer _Keys; // hash buckets for keys + size_t _Length; + core::Number_sp _RehashSize; + double _RehashThreshold; + gctools::tagged_pointer _Keys; // hash buckets for keys gctools::tagged_pointer _Values; // hash buckets for values #ifdef CLASP_THREADS mutable mp::SharedMutex_sp _Mutex; diff --git a/include/clasp/gctools/memoryManagement.h b/include/clasp/gctools/memoryManagement.h index dd5ca8941f..c07257b2e1 100644 --- a/include/clasp/gctools/memoryManagement.h +++ b/include/clasp/gctools/memoryManagement.h @@ -57,10 +57,10 @@ struct ClaspInfo { const char **_argv; size_t _stackMax; core::ThreadLocalState *_threadLocalStateP; + core::LispHolder *_lispHolder; bool _mpiEnabled; int _mpiRank; int _mpiSize; - core::LispHolder *_lispHolder; ClaspInfo(int argc, const char **argv, size_t stackMax) : _argc(argc), _argv(argv), _stackMax(stackMax), _lispHolder(NULL), _mpiEnabled(false), _mpiRank(0), _mpiSize(1){}; diff --git a/include/clasp/gctools/snapshotSaveLoad.h b/include/clasp/gctools/snapshotSaveLoad.h index 5c436ac480..f3737681ea 100644 --- a/include/clasp/gctools/snapshotSaveLoad.h +++ b/include/clasp/gctools/snapshotSaveLoad.h @@ -151,7 +151,10 @@ struct LibraryLookup { uintptr_t _loadAddress; std::string _libraryPath; - LibraryLookup( const std::string libraryPath ) : _libraryPath(libraryPath), _loadAddress(0) {}; + LibraryLookup( const std::string libraryPath ) : + _loadAddress(0), + _libraryPath(libraryPath) + {}; std::map _symbolToAddress; std::map _addressToSymbol; diff --git a/include/clasp/gctools/threadlocal.fwd.h b/include/clasp/gctools/threadlocal.fwd.h index 924f6709e1..014ef3acc3 100644 --- a/include/clasp/gctools/threadlocal.fwd.h +++ b/include/clasp/gctools/threadlocal.fwd.h @@ -29,12 +29,12 @@ namespace gctools { struct GlobalAllocationProfiler { std::atomic _BytesAllocated; - std::atomic _AllocationNumberCounter; + size_t _AllocationSizeThreshold; + size_t _AllocationNumberThreshold; std::atomic _AllocationSizeCounter; + std::atomic _AllocationNumberCounter; std::atomic _HitAllocationNumberCounter; std::atomic _HitAllocationSizeCounter; - size_t _AllocationNumberThreshold; - size_t _AllocationSizeThreshold; #ifdef DEBUG_MONITOR_ALLOCATIONS MonitorAllocations _Monitor; #endif diff --git a/include/clasp/gctools/threadlocal.h b/include/clasp/gctools/threadlocal.h index a6476ef8ad..b533fce82e 100644 --- a/include/clasp/gctools/threadlocal.h +++ b/include/clasp/gctools/threadlocal.h @@ -305,26 +305,25 @@ struct VirtualMachine { List_sp _BufferStrWNsPool; StringOutputStream_sp _BFormatStringOutputStream; StringOutputStream_sp _WriteToStringOutputStream; - - MultipleValues _MultipleValues; - void* _sigaltstack_buffer; - size_t _unwinds; - stack_t _original_stack; - std::string _initializer_symbol; - void* _object_file_start; - size_t _object_file_size; + MultipleValues _MultipleValues; + void* _sigaltstack_buffer; + size_t _unwinds; + stack_t _original_stack; + std::string _initializer_symbol; + void* _object_file_start; + size_t _object_file_size; gctools::GCRootsInModule* _GCRootsInModule; - StartupInfo _Startup; - bool _Breakstep; // Should we check for breaks? + StartupInfo _Startup; + bool _Breakstep; // Should we check for breaks? // What frame are we stepping over? NULL means step-into mode. - void* _BreakstepFrame; + void* _BreakstepFrame; // Stuff for SJLJ unwinding - List_sp _DynEnvStackBottom; - T_sp _UnwindDest; - size_t _UnwindDestIndex; + List_sp _DynEnvStackBottom; + T_sp _UnwindDest; + size_t _UnwindDestIndex; #ifdef DEBUG_IHS // Save the last return address before IHS screws up - void* _IHSBacktrace[IHS_BACKTRACE_SIZE]; + void* _IHSBacktrace[IHS_BACKTRACE_SIZE]; #endif size_t _xorshf_x; // Marsaglia's xorshf generator size_t _xorshf_y; diff --git a/include/clasp/llvmo/code.h b/include/clasp/llvmo/code.h index a422ed6d21..9e8ec97f0f 100644 --- a/include/clasp/llvmo/code.h +++ b/include/clasp/llvmo/code.h @@ -72,7 +72,6 @@ typedef enum { SaveState, RunState } CodeState_t; size_t _FasoIndex; // // Code data - // gctools::GCRootsInModule* _gcRoots; void* _TextSectionStart; void* _TextSectionEnd; @@ -101,21 +100,22 @@ typedef enum { SaveState, RunState } CodeState_t; ObjectFile_O( core::SimpleBaseString_sp codename, JITDylib_sp jitdylib, size_t objectId ) : _State(RunState), _CodeName(codename), + _ObjectId(objectId), _TheJITDylib(jitdylib), _gcRoots(NULL), - _CodeBlock(unbound()), - _ObjectId(objectId) { + _CodeBlock(unbound()) + { DEBUG_OBJECT_FILES_PRINT(("%s:%d:%s codename = %s\n", __FILE__, __LINE__, __FUNCTION__, _rep_(codename).c_str() )); }; ObjectFile_O( core::SimpleBaseString_sp codename, CodeBlock_sp codeBlock, JITDylib_sp dylib, size_t objectId) : _State(RunState), _CodeName(codename), + _ObjectId(objectId), _TheJITDylib(dylib), _gcRoots(NULL), - _CodeBlock(codeBlock), _TextSectionStart(0), _TextSectionEnd(0), - _ObjectId(objectId) + _CodeBlock(codeBlock) { DEBUG_OBJECT_FILES_PRINT(("%s:%d:%s created with CodeBlock_sp codename = %s CodeBlock = %s\n", __FILE__, __LINE__, __FUNCTION__, _rep_(codename).c_str(), core::_rep_(codeBlock).c_str() )); }; diff --git a/include/clasp/llvmo/debugInfoExpose.h b/include/clasp/llvmo/debugInfoExpose.h index 5e81793471..ece22dde98 100644 --- a/include/clasp/llvmo/debugInfoExpose.h +++ b/include/clasp/llvmo/debugInfoExpose.h @@ -863,7 +863,10 @@ struct from_object>, } } from_object(const from_object& orig) = delete; - from_object(from_object&& orig) : _Storage(std::move(orig._Storage)), _v(orig._v) { + from_object(from_object&& orig) : + _v(orig._v), + _Storage(std::move(orig._Storage)) + { if (this->_v.hasValue()) { // printf("%s:%d:%s from_object move ctor\n", __FILE__, __LINE__, __FUNCTION__ ); llvm::DIFile::ChecksumInfo checksum(this->_v->Kind,this->_Storage); diff --git a/include/clasp/llvmo/llvmoExpose.h b/include/clasp/llvmo/llvmoExpose.h index 699b1124af..3c6029d6bd 100644 --- a/include/clasp/llvmo/llvmoExpose.h +++ b/include/clasp/llvmo/llvmoExpose.h @@ -3858,9 +3858,15 @@ struct from_object { typedef llvm::StringRef DeclareType; DeclareType _v; string _Storage; - from_object(T_P object) : _Storage(gc::As(object)->get_std_string()), _v(this->_Storage) {}; + from_object(T_P object) : + _v(this->_Storage), + _Storage(gc::As(object)->get_std_string()) + {}; from_object(const from_object& orig) = delete; - from_object(from_object&& orig) : _Storage(std::move(orig._Storage)), _v(_Storage) {}; + from_object(from_object&& orig) : + _v(_Storage), + _Storage(std::move(orig._Storage)) + {}; }; template <> diff --git a/src/core/string.cc b/src/core/string.cc index b802427f91..92740d4a06 100644 --- a/src/core/string.cc +++ b/src/core/string.cc @@ -189,7 +189,11 @@ struct StringCharPointer { size_t _pos; size_t _start; typedef typename T::simple_element_type CharacterType; - StringCharPointer(const T* strP, size_t start) : _stringPtr(strP), _start(start), _pos(start) {} + StringCharPointer(const T* strP, size_t start) : + _stringPtr(strP) + , _pos(start) + , _start(start) + {} inline size_t offset() { return this->_pos - this->_start;}; CharacterType operator*() { CharacterType c = (*this->_stringPtr)[this->_pos]; diff --git a/src/gctools/threadlocal.cc b/src/gctools/threadlocal.cc index f1f2e852b0..df001a807e 100644 --- a/src/gctools/threadlocal.cc +++ b/src/gctools/threadlocal.cc @@ -112,10 +112,10 @@ bool DynamicBindingStack::thread_local_boundp(uint32_t index) const { namespace gctools { ThreadLocalStateLowLevel::ThreadLocalStateLowLevel(void* stack_top) : - _DisableInterrupts(false) - , _StackTop(stack_top) + _StackTop(stack_top) + , _DisableInterrupts(false) #ifdef DEBUG_RECURSIVE_ALLOCATIONS - , _RecursiveAllocationCounter(0) + , _RecursiveAllocationCounter(0) #endif {}; @@ -193,8 +193,8 @@ VirtualMachine::~VirtualMachine() { // in GC managed memory. ThreadLocalState::ThreadLocalState(bool dummy) : _unwinds(0) - ,_CleanupFunctions(NULL) ,_PendingInterrupts() + ,_CleanupFunctions(NULL) ,_ObjectFiles() ,_BufferStr8NsPool() ,_BufferStrWNsPool()