Copy filename into preallocated field with Cytoplasm's Memory API #33
Loading…
Reference in a new issue
No description provided.
Delete branch "lda/Cytoplasm:direct-filenames"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This exists because there does exist scenarios where a
const char *
may be invalidated during, for example, a memory leak report(especially when shared libraries are involved).Copy filename into preallocated field with Cytoplasm's Memory APIto WIP: Copy filename into preallocated field with Cytoplasm's Memory APIWIP: Copy filename into preallocated field with Cytoplasm's Memory APIto Copy filename into preallocated field with Cytoplasm's Memory APIThe logic and the code is sound, but I do have some concerns with the memory footprint this is going to add. Now every single allocation is 256 bytes bigger? I’ll have to think about how I want to approach this.
As I mentioned in the Matrix room the other day, this adds a lot of memory overhead, because every single allocation (every single call to
Malloc()
is now 256 bytes bigger, and while that might not seem like a lot, it will certainly add up in large, complex programs like Telodendria. I made a comment on #4 about string interning; I think if we could intern strings so that only one copy is stored in memory, that would be an acceptable alternative here.I'm not exactly sure how to go about this, but I'm going to think about it for a little.
After further consideration, this is probably fine. If people complain that Cytoplasm uses too much memory, we can re-evaluate, but I'm okay with this for now.