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

Add pkg-config files to CMake build #211

Closed
wants to merge 131 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
2ecee16
Use uhpa for payloads.
ralight Apr 1, 2015
2da74ad
Use uhpa for topics.
ralight Apr 4, 2015
133d2de
Bump to development version.
ralight Apr 4, 2015
c7d6c1a
UHPA comments.
ralight Apr 4, 2015
0ddd438
Helper macros.
ralight Apr 5, 2015
b8f9aeb
Fix incorrect string termination.
ralight Apr 7, 2015
90dc6d8
Don't use uhpa for whole topics, unlikely to be of benefit.
ralight Apr 11, 2015
2e05e40
[464458] mosquitto_sub: Add option to print the payload in hex.
ralight Apr 17, 2015
11756d2
Change internal funcs _foo_bar() to foo__bar().
ralight Apr 19, 2015
970ba58
Code reorganise.
ralight Apr 29, 2015
b598aec
Sys -> user includes.
ralight Apr 29, 2015
8049c4b
Simplify code around SYS statistics gathering.
ralight May 16, 2015
1744477
Rename/reorganise packet functions.
ralight May 16, 2015
a67d43c
Rename message functions.
ralight May 16, 2015
94ef6ec
Big set of function renames.
ralight May 16, 2015
3c70340
More function renaming.
ralight May 16, 2015
b67c90e
Rename internal datatypes.
ralight May 16, 2015
21946ac
mosquitto__log_printf -> log__printf
ralight May 18, 2015
4195fde
Last raft of renames for the moment.
ralight May 18, 2015
cdbe62c
Outgoing messages with QoS>0 are no longer retried after a timeout.
ralight May 24, 2015
e469843
Produce an error if two bridges share the same local_clientid.
ralight Jun 9, 2015
663d50a
Big function reorganisation.
ralight May 16, 2015
f0511d0
Add user_subject_as_username option
databus23 Jun 5, 2015
7657aac
[469467] Fixes and documentation to use_subject_as_username patch.
ralight Jun 12, 2015
9efc88d
Bump appveyor openssl version.
ralight Jun 12, 2015
f3e216e
Merge branch 'develop' of ssh:https://git.eclipse.org:29418/mosquitto/org.e…
ralight Jun 12, 2015
45d5686
Add missing CROSS_COMPILE.
stoupa-cz Jun 22, 2015
29731b5
[471053] Add systemd support and services.
stoupa-cz Jun 22, 2015
6fe5de4
Merge "[471053] Add systemd support and services." into develop
ralight Jun 26, 2015
bfd743f
Updated uhpa code with "move" function.
ralight Jun 28, 2015
9bccd31
Don't make unnecessary copies of topic in db__messages_store.
ralight Jun 28, 2015
6f193de
[470258] Don't make unnecessary copies of payload in db__messages_store.
ralight Jun 28, 2015
b2496f7
Update appveyor openssl version.
ralight Jun 28, 2015
a4dad02
[470246] Change sys tree print output on USR2.
ralight Jun 29, 2015
a542aae
SF mirror changed.
ralight Jun 29, 2015
5c642c9
[464543] Add defer support for plugins.
ralight Jun 29, 2015
e773ea1
[464543] Run default checks after plugins.
ralight Jun 29, 2015
300034f
Initialise all plugins, not just the first.
ralight Jul 2, 2015
4c14730
Minimum supported libwebsockets version is now 1.3.
ralight Jul 8, 2015
6f88ba3
Use mosquitto_strerror() instead of displaying the rc.
ralight Aug 17, 2015
3f86d31
Allow mosquitto__free(NULL).
ralight Aug 18, 2015
307044e
misc code updates.
ralight Aug 26, 2015
e2324ff
Merge remote-tracking branch 'remotes/origin/master' into develop
ralight Sep 3, 2015
9a2eb20
Drop Windows XP support, misc fixes on Windows.
ralight Sep 22, 2015
66924cd
Windows 64 bit build and installer.
ralight Sep 22, 2015
acb95f2
Fix potential memory leak in mosquitto_sub_topic_tokenise()
ralight Sep 22, 2015
9fb288d
Fix malloc/_mosquitto_free mismatch.
ralight Sep 22, 2015
ed97a3b
Fix potential memory leaks.
ralight Sep 22, 2015
436d3fa
Merge branch 'fixes' into develop
ralight Sep 22, 2015
b4fbe90
Remove more unnecessary "if(x) mosquitto__free(x)" checks.
ralight Sep 22, 2015
0d449d3
strlen(x) == 0 -> STREMPTY(x)
ralight Sep 22, 2015
8ecb929
Disable support for DNS SRV by default.
ralight Sep 22, 2015
f5f1a64
Consistent installer naming.
ralight Sep 22, 2015
2078b63
Log CONNACK result for clients.
ralight Sep 29, 2015
f5f5d38
Fix incorrect defines.
ralight Sep 29, 2015
4afe1a1
Swap plugin+built in order.
ralight Oct 2, 2015
4b9b792
Update all mqtt 3.1 references to 3.1.1 where appropriate.
ralight Oct 24, 2015
8f54cde
Add support for sending direct messages to clients.
ralight Nov 13, 2015
559e243
Revert "Add support for sending direct messages to clients."
ralight Nov 18, 2015
3aa698d
Add -U to mosquitto_sub for unsubscribing from topics.
ralight Dec 29, 2015
fca9ac8
Merge fixes into develop.
ralight Jan 6, 2016
b83c587
Add mosquitto_subscribe_single()/multiple().
ralight Jan 25, 2016
896b456
Add missing helpers code.
ralight Jan 26, 2016
d157e8c
Add examples for subscribe_simple.
ralight Jan 26, 2016
1288b14
Fixes and cleanup for subscribe_simple.
ralight Jan 26, 2016
bd906e6
Fix merge error.
ralight Jan 26, 2016
0a95c9a
Add mosquitto_subscribe_callback().
ralight Jan 26, 2016
7709621
Reorder helper function arguments for consistency.
ralight Jan 26, 2016
4e4c08a
"retained" -> "want_retained".
ralight Jan 26, 2016
1961404
Add --retained-only to mosquitto_sub.
ralight Feb 2, 2016
26b0159
Default to using MQTT v3.1.1.
ralight Feb 5, 2016
97e6ac2
Only increment inflight messages if the limit hasn't been reached.
ralight Feb 9, 2016
d5abf5a
Outgoing connections can use any TLS version.
ralight Feb 9, 2016
f5c4b83
Fix merge error.
ralight Feb 9, 2016
f6939d4
Merge branch 'develop' of ssh:https://git.eclipse.org:29418/mosquitto/org.e…
ralight Feb 9, 2016
6087d4b
Fix incorrect calloc/mosquitto__free pair.
ralight Mar 12, 2016
7f9db87
Makefile target for static compiled pub/sub clients.
ralight Mar 12, 2016
62fa209
Add tests for cmake builds and use on travis.
ralight Mar 12, 2016
59c80d9
Add MQTT URL scheme support
teknoraver Feb 16, 2016
bd61d18
Small tidy up.
ralight Feb 27, 2016
db2e66c
Reorganise functions into separate files as appropriate.
ralight Mar 6, 2016
1b190b1
Fix auth deferring with no pwfile defined.
ralight Mar 13, 2016
8906d67
Default to MQTT v3.1.1 in tests.
ralight Mar 13, 2016
6c8c649
More test fixes.
ralight Mar 13, 2016
556c629
Don't use reserved names in header guards.
ralight Mar 13, 2016
09ea5cb
mosquitto_db_dump can now output some client stats.
ralight Mar 15, 2016
70f2bea
Merging travis config changes across branches.
ralight Mar 15, 2016
37dceb3
Fix some defects discovered by coverity.
ralight Mar 18, 2016
62402f7
Ignore generated test files.
ralight Mar 19, 2016
44f2325
Improve performance with lots of queued message
PierreF Apr 18, 2016
18cc0f5
Fix bugs introduced by previous commit
PierreF Apr 18, 2016
fe93138
Add default config path to systemd services. (#139)
stoupa-cz Apr 19, 2016
3163cf2
Only include man subdirectory if the DOCUMENTATION option is on
Apr 19, 2016
87112a7
On Mac, we don't want to run /sbin/ldconfig as it doesn't exist
Apr 19, 2016
13f28d1
Adding the static library target, libmosquitto_static, to CMakeLists.…
Apr 19, 2016
93906b9
We don't want to add any declaration properties for the static librar…
Apr 19, 2016
3499c09
Putting the list of files into a variable C_SRC and modiftying the ad…
Apr 19, 2016
a0a0cc3
Renaming STATIC_LIB -> LIBMOSQUITTO_STATIC
Apr 21, 2016
81cabb3
Update for github.
ralight Apr 26, 2016
c711941
Merge pull request #144 from anonymouse64/dev/cmake_improvements
ralight May 14, 2016
dfeb2f9
Merge pull request #141 from PierreF/large-queued-performance-2
ralight May 15, 2016
030a217
Improve example.
ralight May 15, 2016
99ea5ca
Default to using port 8883 when using TLS.
ralight May 16, 2016
c6ef86b
Print openssl errors when debugging enabled.
ralight May 16, 2016
b87082c
Fix fail linking of handle* functions in the shared library
lancechentw May 31, 2016
7ee997e
Add an option to control building static library or not
lancechentw May 31, 2016
aa360e4
Add an option to control building static library with PIC or not
lancechentw May 31, 2016
f18e8e1
Add build configuration for CPP static library
lancechentw May 31, 2016
a9b7237
Install/Uninstall the C static library
lancechentw Jun 2, 2016
4b4817c
Build the CPP static library with bare Makefiles
lancechentw Jun 2, 2016
97847fa
Rename option BUILD_STATIC_LIBRARY to WITH_STATIC_LIBRARIES
lancechentw Jun 2, 2016
5ccd0db
Add an build option to control building static libraries or not
lancechentw Jun 2, 2016
54ca15a
Bump appveyor openssl version.
ralight Jun 7, 2016
f8d84a6
Fix cmake test target.
ralight Jun 7, 2016
6c87f7a
Merge pull request #179 from Lance0312/enhance-static-library-build
ralight Jun 7, 2016
d90cd58
Add WITH_STRIP build option.
ralight Jun 13, 2016
2286caa
Merge branch 'enhance-bare-makefile-static-library-build' of https://…
ralight Jun 15, 2016
fa2d314
Separate the C and C++ static libraries.
ralight Jun 15, 2016
a8a5daf
Check client topic inputs for valid UTF-8.
ralight Jun 20, 2016
b1efd9a
db_dump: properly print uint64_t
karlp Jun 21, 2016
339842b
db_dump: (trivial) add missing newline in output
karlp Jun 21, 2016
63e3926
Perform UTF-8 validation on will, sub, unsub topics in the broker.
ralight Jun 21, 2016
1c3988a
Merge branch 'master' into develop
ralight Jun 21, 2016
2b22793
Bridge defaults to mqtt3.1.1 as per documentation.
ralight Jun 21, 2016
6a6efb6
Fix ssl bridge test.
ralight Jun 22, 2016
6eb8b0c
Merge pull request #190 from remakeelectric/db_dump-fixes
ralight Jul 1, 2016
6bf8b59
Signalling mosquitto process on Win32, using named events: (#163)
dkaukov Jul 3, 2016
d543595
Move signals/events code to own file.
ralight Jul 3, 2016
a046622
Remove "mosq%d_vacuum" event as vacuum no longer done.
ralight Jul 3, 2016
7cb8988
websockets: fix compile fail after refactoring (#207)
karlp Jul 7, 2016
1dc1943
Add pkg-config files to CMake build
Jul 12, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
UHPA comments.
  • Loading branch information
ralight committed Apr 4, 2015
commit c7d6c1a86545de14e8380c2b3d22d204b6a69394
41 changes: 41 additions & 0 deletions src/mosquitto_broker.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,47 @@ and the Eclipse Distribution License is available at
/* ========================================
* UHPA data types
* ======================================== */

/* See uhpa.h
*
* The idea here is that there is potentially a lot of wasted space (and time)
* in malloc calls for frequent, small heap allocations. This can happen if
* small payloads are used by clients or if individual topic elements are
* small.
*
* In both cases, a struct is used that includes a void* or char* pointer to
* point to the dynamically allocated memory used. To allocate and store a
* single byte needs the size of the pointer (8 bytes on a 64 bit
* architecture), the malloc overhead and the memory allocated itself (which
* will often be larger than the memory requested, on 64 bit Linux this can be
* a minimum of 24 bytes). To allocate and store 1 byte of heap memory we need
* in this example 32 bytes.
*
* UHPA uses a union to either store data in an array, or to allocate memory on
* the heap, depending on the size of the data being stored (this does mean
* that the size of the data must always be known). Setting the size of the
* array changes the point at which heap allocation starts. Using the example
* above, this means that an array size of 32 bytes should not result in any
* wasted space, and should be quicker as well. Certainly in the case of topic
* elements (e.g. "bar" out of "foo/bar/baz") it is likely that an array size
* of 32 bytes will mean that the majority of heap allocations are removed.
*
* You can change the size of MOSQ_PAYLOAD_UNION_SIZE and MOSQ_TOPIC_UNION_SIZE
* to change the size of the uhpa array used for the payload (i.e. the
* published part of a message) and for topic elements, and so control the heap
* allocation threshold for these data types. You should look at your
* application to decide what values to set, but don't set them too high
* otherwise your overall memory usage will increase.
*
* You could use something like heaptrack
* https://milianw.de/blog/heaptrack-a-heap-memory-profiler-for-linux to
* profile heap allocations.
*
* I would suggest that values for MOSQ_PAYLOAD_UNION_SIZE and
* MOSQ_TOPIC_UNION_SIZE that are equivalent to
* sizeof(void*)+malloc_usable_size(malloc(1)) are a safe value that should
* reduce calls to malloc without increasing memory usage at all.
*/
#define MOSQ_PAYLOAD_UNION_SIZE 8
typedef union {
void *ptr;
Expand Down