Comments (4)
Hello @notcancername, I think anything that adds customizability to concord while also being fully backwards compatible is a win in my book.
Not sure if it's in your plans, but to make sure this works well I think we should also implement some custom dynamic memory functions of our own for when concord is built on debug mode (memory tracking purposes). This should give us a good idea if the implementation makes sense.
I may underestimate the scope of this change
You might be a little bit, but we'll see how it goes!
from concord.
I'm about a day delinquent on this, so, let me compose a long and supposedly eloquent response. I'll do this as a bulleted list:
malloc
output isn't being checked!
Honestly, personally, I feel that ifmalloc
is failing, there are now other issues that are out of the scope of Concord. It could be a memory exhaustion issue (in which case, something somewhere else is about to start suffering, the OS is paging aggressively, or there is some hardware fault with the memory (I don't know of any OSes that report this as a failedmalloc
, usually it'll just emit a message on the operator console and hope the system operator is smart enough to shut the system down and do hardware repair). Ifmalloc
fails for whatever reason, I think a message should be logged somewhere, as that could be implicative of some other issues somewhere else. This should definitely be checked.
Signal safety need not apply!
Why not be signal-safe? Granted, it's hard to implement, but, like all good things in life, one must consider if this is really necessary or not -- I personally don't think it'll be an issue (you don't have to use SIGALRM because you can use a Discord timer), but it could be a very specific use-case thing. Should someone require it, they can implement it on their end since I don't think this is a pressing matter.
Debugging purposes
This is an extremely good reason in my book. "Back in the day," there were (and still are, look at Android's libc) so-called "debugging malloc" libraries that would aid with debugging programs that don't work so well. With tagged debugging information within Concord, debugging information would be more sophisticated than some basic lowest-common-denominator stuff. I think this is reason enough to implement this proposal.
Other language support
Ideally, for other languages, you don't want to pull control out of their runtime library with random C library functions -- this could especially be an "issue" in languages that have more sophisticated memory-safety features that don't look too positively upon hidden-away memory allocation or freeing.
Using a GC with Concord
That'd be an interesting concept, but, I don't know if anyone's really looking for that per se, most C programmers look down upon the idea of garbage collection, since all of that was figured out ahead-of-time in the program implementation stage. Nonetheless, it'd be a cool technical feat!
from concord.
malloc error checking
I agree. The system functions installed by ccord_global_init
check the return value.
why no signal safety
mmap(2)
is not AS-safe. fprintf
, which is used for error reporting, is not AS-safe.
debug malloc
Seems reasonable, I probably won't implement this in this proposal though. It would also require some fairly unclean macro hackery.
other language support
I agree.
GC
fair
from concord.
The printf
family is a classic example because you can (quite easily) get two strings mixing together on the terminal. Fortunately, I don't think it'll be a massive issue for us at all, since we basically don't ever handle signals. I think that weeds out most of the possible issues!
from concord.
Related Issues (20)
- Support HTTP 1.1
- Add guides to Concord HOT 11
- Websocket payloads taking long to be sent HOT 3
- Chash (used on Concord) possible not working on FreeBSD HOT 1
- Segfault due to race conditions in discord_cleanup when called from another thread HOT 7
- Incomplete presence info and guild members HOT 15
- discord_modify_channel rtc_region issue HOT 2
- Insufficient buffer size causes truncation, malformed request
- Signal Safety in concord-once.h HOT 2
- Make Error - Windows, Cygwin HOT 3
- WebSocket upgrade fails with 'server didn't accept the websocket upgrade' error when using an HTTP proxy HOT 1
- Raspberry Pi (64-bit) library setup problem HOT 3
- Easy server member permission checking HOT 1
- Wrong compiler for discord_codecs breaks cross HOT 6
- Ship a pkg-config file
- messages: Support silent flag HOT 12
- `DISCORD_MAX_MESSAGE_LEN` has the wrong value HOT 3
- Enums to pointer to enums
- Pass additional data to callbacks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from concord.