code style problem
There is a lot malloc/free . very bad code style
and use busy loop to waiting for messages ( I'm not refer to the pull form TX server, but the pthread that check for the message queue. )
bad code style
lot of void* , bad code style
:(
hope you guys will improve
it 's c ; not java ; no gc
i'm also considered this question.
infact i didn't know there is a better way to implement.
if you know. please teach me.
2013/1/6 microcai [email protected]
There is a lot malloc/free . very bad code style
and use busy loop to waiting for messages ( I'm not refer to the pull form TX server, but the pthread that check for the message queue. )
bad code style
lot of void* , bad code style
:(
hope you guys will improve
— Reply to this email directly or view it on GitHubhttps://github.com/mathslinux/lwqq/issues/19.
Hi, Since we developed it with C, so malloc()/free() were unavoidable, but I have wraped them as s_malloc()/s_free(). Maybe for later development, we can implement a memory pool by reworking s_malloc()/s_free() with caller remaining unchanged.
For busy loop designed for receiving messages, I must admit that there are little suck for this design. So, if you have any better suggestion, patches are welcome!
I have an libwebqq implemented inside qqbot (https://github.com/microcai/qqbot )
Just one thread, no busy loop. two polling connection. every thing is done async.
must of the code is copy&paste from lwqq .
good job
2013/1/7 microcai [email protected]
I have an libwebqq implemented inside qqbot ( https://github.com/microcai/qqbot )
Just one thread, no busy loop. two polling connection. every thing is done async.
must of the code is copy&paste from lwqq .
— Reply to this email directly or view it on GitHubhttps://github.com/mathslinux/lwqq/issues/19#issuecomment-11944677.
If you develop in C, the trick is to use glib. glib provide g_new/g_free , and for async loop, you have g_main_loop pruple have pruple loop wrapper arround g_main_loop , you can use neither glib nor pruple.