Copy filename into preallocated field with Cytoplasm's Memory API #33

Open
lda wants to merge 2 commits from lda/Cytoplasm:direct-filenames into master
Contributor

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).

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).
lda added 1 commit 2024-05-26 15:04:12 -05:00
lda changed title from Copy filename into preallocated field with Cytoplasm's Memory API to WIP: Copy filename into preallocated field with Cytoplasm's Memory API 2024-05-26 15:04:31 -05:00
lda added 1 commit 2024-05-26 15:07:01 -05:00
lda changed title from WIP: Copy filename into preallocated field with Cytoplasm's Memory API to Copy filename into preallocated field with Cytoplasm's Memory API 2024-05-26 15:07:15 -05:00
Owner

The 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.

The 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.
Owner

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.

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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b lda-direct-filenames master
git pull direct-filenames

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff lda-direct-filenames
git push origin master
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Telodendria/Cytoplasm#33
No description provided.