Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jfriesne/muscle
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v9.40
Choose a base ref
...
head repository: jfriesne/muscle
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 319 changed files with 12,021 additions and 4,630 deletions.
14 changes: 14 additions & 0 deletions CMAKEOPTIONS.txt
Original file line number Diff line number Diff line change
@@ -93,3 +93,17 @@ command. Here is a list of flags that the CMakeLists.txt file recognizes:
-DWITH_EXAMPLES "Enable building of muscle examples" (defaults to ON)
Enable building of the example programs that go with the "MUSCLE by example"
HTML guide/tutorial.

-DWITH_TAGGED_POINTERS "Enable Tagged Pointers" (defaults to ON)
Enable tagged pointers support (i.e. the use of otherwise-always-zero bits
in the pointers held by the PointerAndBools class to hold boolean values)
This reduces memory usage but could potentially cause problems on some platforms.

-DWITH_OBJECT_COUNTING "Object Counting Instrumentation" (defaults to OFF)
Enable CountedObject support. Specifying this will make the CountedObject
class not be a no-op, so that you can (in exchange for a slight cost in
run-time efficiency) call PrintCountedObjectInfo() at any time to get a
count of the number of objects of each type that are currently present
in this process's RAM. This is can be useful when investigating the
nature of problems causing excessive memory usage.

35 changes: 31 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -70,6 +70,22 @@ if (WITH_THREAD_SANITIZER)
add_link_options(-fsanitize=thread)
endif()

option(WITH_TAGGED_POINTERS "Enable Tagged Pointers" ON)
if (WITH_TAGGED_POINTERS)
# empty
else()
message("Note: -DWITH_TAGGED_POINTERS=OFF argument was specified: PointerAndBits class will use separate fields instead")
add_definitions(-DMUSCLE_AVOID_TAGGED_POINTERS)
endif()

option(WITH_OBJECT_COUNTING "Object Counting Instrumentation" OFF)
if (WITH_OBJECT_COUNTING)
message("Note: -DWITH_OBJECT_COUNTING=ON argument was specified: Classes containing a CountedObject will be tracked and a census available via PrintCountedObjectInfo()")
add_definitions(-DMUSCLE_ENABLE_OBJECT_COUNTING)
else()
# empty
endif()

option(WITH_DEADLOCKFINDER "Enable building with MUSCLE's potential-deadlock-detection logic enabled" OFF)
if (WITH_DEADLOCKFINDER)
message("Note: -DWITH_DEADLOCKFINDER=ON argument was specified: MUSCLE will include expensive run-time debug-checks for potential deadlock conditions when locking Mutexes.")
@@ -86,13 +102,18 @@ file(GLOB MUSCLE_SRCS
"./dataio/*.cpp"
"./iogateway/*.cpp"
"./message/*.cpp"
"./platform/emscripten/*.cpp"
"./reflector/*.cpp"
"./regex/*.cpp"
"./syslog/*.cpp"
"./system/*.cpp"
"./util/*.cpp"
"./zlib/*.cpp"
"./zlib/zlib/contrib/minizip/*.c"
"./zlib/zlib/contrib/minizip/ioapi.c"
"./zlib/zlib/contrib/minizip/iowin32.c"
"./zlib/zlib/contrib/minizip/mztools.c"
"./zlib/zlib/contrib/minizip/unzip.c"
"./zlib/zlib/contrib/minizip/zip.c"
)

option(WITH_SSL "Enable OpenSSL Support" OFF)
@@ -144,10 +165,9 @@ if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
add_library(muscle ${MUSCLE_SRCS})
else ()
add_library(muscle STATIC ${MUSCLE_SRCS})
target_compile_options(muscle PUBLIC -fembed-bitcode)
target_link_libraries(muscle -fembed-bitcode)
set_target_properties(muscle PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION A # Version "A" is macOS convention
MACOSX_FRAMEWORK_IDENTIFIER com.meyersound.muscle
)
install(TARGETS muscle
@@ -251,10 +271,17 @@ if (APPLE)
endif()
endif (APPLE)

if (${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
add_compile_options(-sUSE_PTHREADS=1)
target_link_libraries(muscle websocket.js)
endif()

if (WIN32)
target_include_directories(muscle PRIVATE "./regex/regex" "./zlib/zlib")
else (!WIN32)
target_link_libraries(muscle util) # for forkpty()
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
target_link_libraries(muscle util) # for forkpty()
endif()
if (ZLIB_FOUND)
target_link_libraries(muscle z)
else (!ZLIB_FOUND)
15 changes: 9 additions & 6 deletions COMPILEROPTIONS.txt
Original file line number Diff line number Diff line change
@@ -54,6 +54,12 @@ of your Makefile to alter muscle's behaviour:
you are able to guarantee that your program will never access MUSCLE
code from more than one thread.

-DMUSCLE_USE_DUMMYNOP
Causes the SocketMultiplexer class to be implemented as a dummy/no-op
class. In this mode, SocketMultiplexer::WaitForEvents() will always
return B_NO_ERROR immediately, and the IsReadyForXXX() methods will
always return true.

-DMUSCLE_USE_EPOLL
Causes the SocketMultiplexer class to use the epoll() Linux system
call instead of select(). This method is less portable, but
@@ -194,9 +200,6 @@ of your Makefile to alter muscle's behaviour:
-DSMALL_QUEUE_SIZE=N
Number of value slots to initially pre-allocate in a Queue, by default. (defaults to 3)

-DSMALL_MUSCLE_STRING_LENGTH=N
strings <= this length will be stored inline in the String object to avoid a malloc()... default is 7

-DMUSCLE_USE_QUERYPERFORMANCECOUNTER
Tells MUSCLE's GetRunTime64() to use the higher-resolution
QueryPerformanceCounter() API instead of timeGetTime() when running under Windows.
@@ -405,7 +408,7 @@ of your Makefile to alter muscle's behaviour:
Android's MTE pointer-tagging feature) and to 0 when
compiling under any other build environment.

-DMUSCLE_AVOID_CLOCK_MONOTONIC_RAW
-DMUSCLE_USE_CLOCK_MONOTONIC_RAW
If specified, then the librt implementation of
GetRunTim64() will use CLOCK_MONOTONIC instead of
CLOCK_MONOTONIC_RAW
GetRunTim64() will use CLOCK_MONOTONIC_RAW instead of
CLOCK_MONOTONIC.
Loading