Repository navigation
gtk: allocate Gtk memory with 'atomic-interior #375
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,7 +21,8 @@ | |||||||||
| (define-cstruct _GtkTreeIter ([stamp _int] | ||||||||||
| [user_data _pointer] | ||||||||||
| [user_data2 _pointer] | ||||||||||
| [user_data3 _pointer])) | ||||||||||
| [user_data3 _pointer]) | ||||||||||
| #:malloc-mode 'atomic-interior) | ||||||||||
|
|
||||||||||
| (define _GtkListStore (_cpointer 'GtkListStore)) | ||||||||||
| (define _GtkCellRenderer (_cpointer 'GtkCellRenderer)) | ||||||||||
|
|
@@ -36,7 +37,7 @@ | |||||||||
| (define-gtk gtk_scrolled_window_new (_fun _pointer _pointer -> _GtkWidget)) | ||||||||||
| (define-gtk gtk_scrolled_window_set_policy (_fun _GtkWidget _int _int -> _void)) | ||||||||||
|
|
||||||||||
| (define-gtk gtk_list_store_newv (_fun _int (_list i _long) -> _GtkListStore)) | ||||||||||
| (define-gtk gtk_list_store_newv (_fun _int (_list i _long atomic-interior) -> _GtkListStore)) | ||||||||||
| (define-gtk gtk_list_store_clear (_fun _GtkListStore -> _void)) | ||||||||||
| (define-gtk gtk_list_store_append (_fun _GtkListStore _GtkTreeIter-pointer _pointer -> _void)) | ||||||||||
| (define-gtk gtk_list_store_set (_fun #:varargs-after 2 | ||||||||||
|
|
@@ -83,7 +84,7 @@ | |||||||||
| (define-gtk gtk_tree_path_free (_fun _pointer -> _void)) | ||||||||||
| (define-gtk gtk_tree_path_get_indices (_fun _pointer -> _pointer)) | ||||||||||
|
|
||||||||||
| (define-gtk gtk_tree_view_get_visible_range (_fun _GtkWidget [sp : (_ptr o _pointer)] [ep : (_ptr o _pointer)] | ||||||||||
| (define-gtk gtk_tree_view_get_visible_range (_fun _GtkWidget [sp : (_ptr o _pointer atomic-interior)] [ep : (_ptr o _pointer atomic-interior)] | ||||||||||
| -> [ok? : _gboolean] | ||||||||||
| -> (values (if ok? sp #f) (if ok? ep #f)))) | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Debugging detailsTextual replacement(line-replacement
#:new-lines
'#(" -> (values (and ok? sp) (if ok? ep #f))))")
#:original-lines
'#(" -> (values (if ok? sp #f) (if ok? ep #f))))")
#:start-line 89)Syntactic replacement(syntax-replacement
#:introduction-scope #<procedure:...and/syntax-local.rkt:148:2>
#:new-syntax
#<syntax:/home/runner/.local/share/racket/9.4.0.2/pkgs/resyntax/default-recommendations/boolean-shortcuts.rkt:63:2 (and ok? sp)>
#:original-syntax
#<syntax:gui-lib/mred/private/wx/gtk/list-box.rkt:89:61 (if ok? sp #f)>
#:source
(file-source
#<path:/home/runner/work/gui/gui/gui-lib/mred/private/wx/gtk/list-box.rkt>)
#:uses-universal-tagged-syntax? #f)There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Debugging detailsTextual replacement(line-replacement
#:new-lines
'#(" -> (values (if ok? sp #f) (and ok? ep))))")
#:original-lines
'#(" -> (values (if ok? sp #f) (if ok? ep #f))))")
#:start-line 89)Syntactic replacement(syntax-replacement
#:introduction-scope #<procedure:...and/syntax-local.rkt:148:2>
#:new-syntax
#<syntax:/home/runner/.local/share/racket/9.4.0.2/pkgs/resyntax/default-recommendations/boolean-shortcuts.rkt:63:2 (and ok? ep)>
#:original-syntax
#<syntax:gui-lib/mred/private/wx/gtk/list-box.rkt:89:76 (if ok? ep #f)>
#:source
(file-source
#<path:/home/runner/work/gui/gui/gui-lib/mred/private/wx/gtk/list-box.rkt>)
#:uses-universal-tagged-syntax? #f) |
||||||||||
|
|
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let-to-define: Internal definitions are recommended instead ofletexpressions, to reduce nesting.Debugging details
Textual replacement
(line-replacement #:new-lines '#(" (for ([str (in-list types)]" " [i (in-naturals)])" " (define t (ptr-add targets i _GtkTargetEntry))" " (cpointer-push-tag! t 'GtkTargetEntry)" " (set-GtkTargetEntry-target! t str)" " (set-GtkTargetEntry-flags! t 0)" " (set-GtkTargetEntry-info! t i))") #:original-lines '#(" (for ([str (in-list types)]" " [i (in-naturals)])" " (let ([t (ptr-add targets i _GtkTargetEntry)])" " (cpointer-push-tag! t 'GtkTargetEntry)" " (set-GtkTargetEntry-target! t str)" " (set-GtkTargetEntry-flags! t 0)" " (set-GtkTargetEntry-info! t i)))") #:start-line 184)Syntactic replacement
(syntax-replacement #:introduction-scope #<procedure:...and/syntax-local.rkt:148:2> #:new-syntax #<syntax:.../resyntax/base.rkt:215:28 (for ((str (in-list types)) (i (in-naturals))) (define t (ptr-add targets i _GtkTargetEntry)) (cpointer-push-tag! t (quote GtkTargetEntry)) (set-GtkTargetEntry-target! t str) (set-GtkTargetEntry-flags! t 0) (set-GtkTargetEntry-info! t i))> #:original-syntax #<syntax:gui-lib/mred/private/wx/gtk/clipboard.rkt:184:10 (for ((str (in-list types)) (i (in-naturals))) (let ((t (ptr-add targets i _GtkTargetEntry))) (cpointer-push-tag! t (quote GtkTargetEntry)) (set-GtkTargetEntry-target! t str) (set-GtkTargetEntry-flags! t 0) (set-GtkTargetEntry-info! t i)))> #:source (file-source #<path:/home/runner/work/gui/gui/gui-lib/mred/private/wx/gtk/clipboard.rkt>) #:uses-universal-tagged-syntax? #f)