-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for automatically calling unsafe_load() in getproperty()
Copying the description from the code: > By default the getproperty!(x::Ptr, ::Symbol) methods created for wrapped > types will return pointers (Ptr{T}) to the struct fields. That behaviour is > useful for accessing nested struct fields but it does require explicitly > calling unsafe_load() every time. When enabled this option will automatically > call unsafe_load() for you *except on nested struct fields and arrays*, which > should make explicitly calling unsafe_load() unnecessary in most cases.
- Loading branch information
1 parent
a226276
commit d901cb7
Showing
7 changed files
with
256 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
typedef struct { | ||
int i; | ||
} TypedefStruct; | ||
|
||
struct Other { | ||
int i; | ||
}; | ||
|
||
struct WithFields { | ||
int int_value; | ||
int* int_ptr; | ||
|
||
struct Other struct_value; | ||
struct Other* struct_ptr; | ||
TypedefStruct typedef_struct_value; | ||
|
||
int array[2]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters