Attention is currently required from: daniel, fixeria, lynxis lazus, osmith, 
pespin.

laforge has posted comments on this change by pespin. ( 
https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42219?usp=email )

Change subject: Use talloc to allocate asn1c decoded structs
......................................................................


Patch Set 2:

(1 comment)

File src/tcap.c:

https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42219/comment/84eb6adb_3ea17558?usp=email
 :
PS2, Line 29: vo
> But as mentioned above, defining it as weak actually deceives the  reason to 
> have the global symbol in first place, apps are still not required to set it, 
> so we are in the same position as with using a real function API.

I was thinking of declaring it as non-weak in the library, but defining it as 
weak in all the applications/libraries that use it. This way at least one of 
them must define it, while still not clashing?

The "perfect" solutions for multiple users of libasn1c would likely have been 
to make all calls pass around a context, so each user (in another library or 
application) can pass the talloc context into each encode/decode operation, and 
hence track only their own objects' memory usage wherever they want - doing 
away with a global variable in the first place.  That in turn however of course 
breaks the asn1c API.  Too late for libasn1c, but potentially not yet for 
libosmo-asn1-tcap.  However, I think the number of new users we see for 
libosmo-asn1-tcap is likely very low, so also not really worth it.

Feel free to go ahead with your approach, if you think it's superior.



--
To view, visit https://gerrit.osmocom.org/c/libosmo-asn1-tcap/+/42219?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: libosmo-asn1-tcap
Gerrit-Branch: master
Gerrit-Change-Id: I6d885527caa5b60011b4fac341b93026ab1833d9
Gerrit-Change-Number: 42219
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Attention: osmith <[email protected]>
Gerrit-Attention: pespin <[email protected]>
Gerrit-Attention: fixeria <[email protected]>
Gerrit-Attention: daniel <[email protected]>
Gerrit-Attention: lynxis lazus <[email protected]>
Gerrit-Comment-Date: Fri, 27 Feb 2026 13:11:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <[email protected]>
Comment-In-Reply-To: pespin <[email protected]>

Reply via email to