Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Find a way with const-quantified parameters #6

Open
Nisiyama-Suzune opened this issue Oct 22, 2019 · 0 comments
Open

Find a way with const-quantified parameters #6

Nisiyama-Suzune opened this issue Oct 22, 2019 · 0 comments

Comments

@Nisiyama-Suzune
Copy link
Collaborator

Currently Keyedge can deal with single-layered const quantifiers, say const char*. However I do not think it can handle a complex quantifier nightmare until we find out how LibClang and C++ standard deal with all the quantifier-nesting. Given that it occurs sufficiently infrequently in libraries, and there is actually a memory leak issue below, it might be worthwhile to just port these functions by hand when it shows up.

The memory leak thing is like this: say you have a function like foo(const char* str), you cannot free the memory str occupies due to the nature that it is const-quantified. Therefore, if the edge wrapper does not free it, it is leaked unless you const-cast it. In the current implementation the wrapper frees every const variable it comes across with, so that they do not become leaked. However, this also means that whatever pointer pointing to them also becomes invalidated, which sounds to me like a bug more than a feature. We need to revise on how that works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant