Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev branch #1271

Merged
merged 23 commits into from
Aug 6, 2024
Merged

Merge dev branch #1271

merged 23 commits into from
Aug 6, 2024

Conversation

cbnolok
Copy link
Contributor

@cbnolok cbnolok commented Aug 6, 2024

No description provided.

cbnolok and others added 23 commits June 17, 2024 18:53
…efault container from map of vectors to a multimap, also trying to delete elements as little as possible, to avoid cpu usage, reallocations and tree rebalancing).

Added #define MT_ENGINES: it doesn't make sense to keep unneeded mutex locks, at least until (if ever) we'll have a fully multithreaded engine.
Some advancement in making ASAN work on Windows with Clang.
Added .cmake-format
Reduced CSector member data types as needed, to save memory.
Added a security check to CSFile::r_Write, at shutdown there might be a request to write to an invalid file descriptor (tested on Linux, tried to write on fd -1).
Added macro SECTORSIZE_DEFAULT instead of using 64 as a magic number.
…dynamically allocating memory for it each time, pre-allocate and request cached CWorldSearch instances. Use CWorldSearch::GetInstance().

Added cdrc external library (reference counted smart pointers, std::shared_ptr is too slow) and new CSReferenceCount sphere library. Cdrc has been slightly modified in order to be used and compiled in a multi-file project. See custom folder.
Added HAS_FLAGS_STRICT and HAS_FLAGS_ANY macros.
Fixed macOS compilation error.
CWorldSearchHolder now uses CSReferenceCount instead of rc_ptr, which is more complex and slightly slower.
Modified some ADDTOCALLSTACK calls for frequently called functions.
Changed some rand val generations in CCharFight to use the fast algorithm.
Inlined some small functions.
Fixed some Linux compilation warnings and errors.
MSVC will compile by default with SSE2 CPU extensions enabled on x86_64. Updated CMakeDetectArch.cmake with 3rd party code.
…significantly reduced CPU usage and (slightly) reduced startup time.

- Fixed: RAM usage always increasing during uptime. Caused by a couple of memory leaks, the greatest happening because the cached map blocks were not properly released.
- Fixed: adopted a more conservative memory allocation policy for strings, resulting in reduced RAM usage.
- Changed: I_MEMORY (ITEMID_MEMORY) items won't have anymore the ComponentProps Faction, ItemChar, Item, reducing their memory footprint.
…umber with a different base (seconds or tenths of seconds or milliseconds) in different contexts. Now they expect in scripts only values in seconds.

Fixed: crash when moving a char in an area full of teleporters, or whichever items made the char move multiple times in the same tick.
Fixed: buffer read past the end in CCacheableScriptFile first reading.
Fixed: if a char had the COMM_CRYSTAL flag enabled, it called ::OnHear on every item in range, without checking if the item is actually capable of hearing.
Further optimized distance checks.
Separated the Github workflows into different files, in order to get a different badge for each build platform/type.
Dismissed AppVeyor build.
Added sphere_library/sfastmath.h.
Fixeid an invalid memory read when reading the last script file line.
Added more log messages for Linux x86 build and Coverity upload
workflow.
…ags. (#1237)

Fixed duration of hallucination spell.
Fixed wrong layer for potion delay.
Fixed wrong sound id for changing monster sounds schema.
Fixed Attacker_GetHighestThreat: return -1 would make the NPC threat lesser than the ATTACKER_THREAT_TOLDBYMASTER and make CChar::NPC_GetAttackMotivation not work correctly for attacking pets.
Fixed NPC_Act_Follow use combat target even if the npc is not in combat.
- Fixed: ini CommandPrefix being overwritten by data from other ini settings.
- Fixed: function call stack sometimes being subject to a race condition between two writing threads, corrupting it.
- Fixed: lots of memory corruption errors leaving the server unstable when loading a broken save file and recovering by loading a backup save.
- Fixed: CCacheableScriptFile sometimes not reading the last character.
- Fixed: .clang_format.
- Changed: RES_GET_INDEX macro to ResGetIndex function, allowing more integer type safety. Same for RES_GET_TYPE.
- Changed: Renamed THREAD_* macros to MT_*. Split them in always active macros (MT_*) and macros active only when MT_ENGINE is set to 1 (MT_ENGINE_*). There are some situations where we still need a mutex
even if not working with multithreaded script/networking engines (which are NOT complete).
- Changed: Disable signal handlers under Linux if running with ASAN or a debugger.
- Added: NOEXCEPT_DEBUG, it's simply the noexcept specifier, but it's ignored if running in a debug build (useful if we're using DEBUG_ASSERT inside a function which wouldn't otherwise throw an exception).
- Fixed: some undefined behaviors, like signed to unsigned conversion and vice versa.
- Added: additional checks for GCC and Clang ASAN builds.
And fixed non-windows compilation error.
Fixed a couple more undefined behaviors.
@cbnolok cbnolok merged commit 4ea4325 into master Aug 6, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants