-
Notifications
You must be signed in to change notification settings - Fork 119
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
Partial string leak #1714
Comments
Is there hope that this gets fixed soon? That is, prior to GC? |
Current minimal limit to run this:
|
Please note that just implementing this would be also a big step. |
As I understand reading through the code, this will only happen with GC, because partial strings are allocated in the atom table. One thing that could be done is to allocate partial strings in another place. An "partial string table" would have the same problem, but maybe they can be allocated in the heap (and therefore avoid this problem completely)? I'm not sure, can you think of any cases where a partial string can't be allocated in the heap? |
One place that comes to mind is when using something like |
I think, however, that the copying from heap to the atom table could be very expensive, and that would make things such as |
The atom table is currently used. But it should not be used. See #24 |
From what I understood of #24, the partial strings are supposed to be allocated in the heap then? But what about my concerns about cases where the string shouldn't be backtracked? Am I misunderstanding how the heap works? |
Ok, going through the code it seems I'm not misunderstanding how the heap works. I think I now know what a |
yes, that's all |
The idea is that partial strings are a compact replacement for list of characters. That is, a program with partial strings should at best compress terms by a factor of 16 (or 24, would 1 There is one case where the representation may be less efficient: A dynamically allocated partial string that ends within the next word. That is the 0 is the only character in the next word. This can only happen if the partial string was initially longer, and the prefix up to the last character has become garbage. Thus GC should take care of this in the same manner as GC should that care of an unused list of characters. |
Simply going through the term (i.e. partial list) should not require any extra memory.
*/
The text was updated successfully, but these errors were encountered: