Memory Management Improvements #148
Labels
No Label
android
arch
backlog
blocked-on-external
bug
bugbash
component/bindings
component/bine
component/connectivity
component/cwtch
component/tapir
component/ui
cwtch-1.14
cwtch-1.15
cwtch-beta-1.1
cwtch-beta-1.10
cwtch-beta-1.11
cwtch-beta-1.12
cwtch-beta-1.13
cwtch-beta-1.2
cwtch-beta-1.3
cwtch-beta-1.4
cwtch-beta-1.5
cwtch-beta-1.5.x
cwtch-beta-1.6
cwtch-beta-1.7
cwtch-beta-1.8
cwtch-beta-1.9
design
duplicate
enhancement
flutter
funding-needed
help wanted
hybrid-groups
in-nightly
in-progress
invalid
ios
linux
mac
need-replication-or-investigation
ops
packaging
post-stable
question
questionable
requires-more-effort-than-we-can-spare
rust
scheduled
stable-blocker
tails
testing-needed
tests
tor
waiting-on-fix-confirmation
waiting-on-new-flutter-feature
whonix
windows
wontfix
No Milestone
No project
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cwtch.im/cwtch-ui#148
Loading…
Reference in New Issue
No description provided.
Delete Branch "memory"
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?
Free Pointers Allocated by NativeUTF8
Also use new c_FreePointer from libCwtch to free returned strings
after they have been processed.
Requires cwtch.im/libcwtch-go#19
ed43063a61
to3cf81e41d6
aside from one comment I think this looks good to me
kinda wish there was a more meta programming way to tackle this, like a generic function caller function we could write... but I can't think of anything off the top of my head... unless we want a 3rd set or argument sized fns to go with the pointers like mem_safe_invoke_1str, mem_safe_invoke_2str etc etc etc
then move the function pointer loading to Start() and store them all in the class and wrap them there too
@ -138,9 +130,7 @@ class CwtchFfi implements Cwtch {
// Called on object being disposed to (presumably on app close) to close the isolate that's listening to libcwtch-go events
@override
void dispose() {
if (cwtchIsolate != null) {
why remove? the isolate isn't assigned till Start() so there is a theoretical chance it could be null when called. Also I think we might have put that in when we were covering our asses about trying to gracefully shutdown and putting shutdown calls in multiple places so as to prevent it getting double unallocated and segfaulting on "graceful" exit
Flutter linting declares this check as unnecessary. CwtchIsolate can never assigned to null after it is initialized.
@ -414,0 +467,4 @@
// ignore: non_constant_identifier_names
// Incredibly dangerous function which invokes a free in libCwtch, should only be used
// as documented in `MEMORY.md` in libCwtch repo.
void _UnsafeFreePointerAnyUseOfThisFunctionMustBeDoubleApproved(Pointer<Utf8> ptr) {
LOL
WIP: Memory Management Improvementsto Memory Management ImprovementsDrone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch-ui/179