@@ -102,7 +102,7 @@ function returns using C<explicitly-manage> :
102
102
my $string = "FOO";
103
103
explicitly-manage($string);
104
104
set_foo($string);
105
-
105
+
106
106
= head1 Basic use of Pointers
107
107
108
108
When the signature of your native function needs a pointer to some native type
@@ -111,7 +111,7 @@ When the signature of your native function needs a pointer to some native type
111
111
# C prototype is void my_version(int *mayor, int *minor)
112
112
sub my_version(int32 is rw, int32 is rw) is native('foo') { * }
113
113
my_version(my int32 $mayor, my int32 $minor); # Pass a pointer to
114
-
114
+
115
115
Sometimes you need to get a pointer (for example, a library handle) back from a
116
116
C library. You don't care about what it points to - you just need to keep hold
117
117
of it. The Pointer type provides for this.
@@ -232,12 +232,12 @@ CStruct reprs). Other than that, you can do the usual set of things you would wi
232
232
a class; you could even have some of the attributes come from roles or have them
233
233
inherited from another class. Of course, methods are completely fine too. Go wild!
234
234
235
- CStruct objects are passed to native functions by reference and native functions
236
- must also return CStruct objects by reference. The memory management
237
- rules for these references are very much like the rules for arrays, though simpler
238
- since a struct is never resized. When you create a struct, the memory is managed for
239
- you and when the variable(s) pointing to the instance of a CStruct go away, the memory
240
- will be freed when the GC gets to it. When a CStruct-based type is used as the return
235
+ CStruct objects are passed to native functions by reference and native functions
236
+ must also return CStruct objects by reference. The memory management
237
+ rules for these references are very much like the rules for arrays, though simpler
238
+ since a struct is never resized. When you create a struct, the memory is managed for
239
+ you and when the variable(s) pointing to the instance of a CStruct go away, the memory
240
+ will be freed when the GC gets to it. When a CStruct-based type is used as the return
241
241
type of a native function, the memory is not managed for you by the GC.
242
242
243
243
NativeCall currently doesn't put object members in containers, so assigning new values
@@ -299,8 +299,8 @@ You have to call C<.deref> on it to access the embeded type.
299
299
my Pointer[MyCstruct] $p2 = some_c_routine();
300
300
my MyCstruct $mc = $p2.deref;
301
301
say $mc.field1;
302
-
303
-
302
+
303
+
304
304
305
305
= head1 Buffers and Blobs
306
306
@@ -362,7 +362,7 @@ version or just a part of it (Try to stick to Major version, some BSD does not c
362
362
363
363
my List $lib = ('foo', 'v1');
364
364
sub foo is native($lib);
365
-
365
+
366
366
367
367
= head2 Routine
368
368
0 commit comments