Skip to content

Commit f6636e2

Browse files
committed
[S21] Fixed some POD formatting errors.
The errors were mainly problems with item lists and missing whitespace around directives.
1 parent 6fca0a0 commit f6636e2

File tree

1 file changed

+40
-9
lines changed

1 file changed

+40
-9
lines changed

S21-calling-foreign-code.pod

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ so edit it there in the git repository if you would like to make changes.
3131
use NativeCall;
3232

3333
sub native_function(int arg) is native('libsomething') { * }
34-
sub short_name() is native('libsomething') is symbol('long_and_complicated_name) { * }
34+
sub short_name() is native('libsomething') is symbol('long_and_complicated_name') { * }
3535

3636
native_function(42);
3737

@@ -43,10 +43,15 @@ Languages like Fortran and C++ require name mangling, which is
4343
compiler-specific and thus falls well beyond the scope of this specification.
4444

4545
Hypotheticals:
46-
=for item
46+
47+
=over
48+
49+
=item
4750
This is likely not an exhaustive list of showstoppers for C++/Fortran compat;
4851
also, some platforms may be tricky simply in terms of C interop as well
4952

53+
=back
54+
5055
=head2 Calling foreign code
5156

5257
A sub is marked as a native routine with the C<is native> trait. A native sub
@@ -134,35 +139,50 @@ Numeric types, both native types and not, have obvious marshalling semantics
134139
(as long as they are not arbitrary-precision types). A NativeCall
135140
implementation should suport the following types:
136141

142+
=over
143+
137144
=item C<int8>, C<uint8> signed and unsigned byte
145+
138146
=item C<int16>, C<uint16> signed and unsigned two-byte integer
147+
139148
=item C<int32>, C<uint32> signed and unsigned four-byte integer
149+
140150
=item C<int64>, C<uint64> signed and unsigned eight-byte integer
151+
141152
=item C<int>, C<uint> signed and unsigned machine word
153+
142154
=item C<Int> largest available integer type
143155

144156
=item C<num32> four-byte floating point number
157+
145158
=item C<num>, C<num64> eight-byte floating point number
146159

160+
=back
161+
147162
Hypotheticals:
148-
=for item
163+
164+
=over
165+
166+
=item
149167
This is a wider range of native types than what S02 mandates. We'll either
150168
want to expand that list of natives, or find some other way of specifying
151169
sizes.
152170

153-
=for item
171+
=item
154172
There is no obvious mirror of C<Int> for largest available I<unsigned> type.
155173

156-
=for item
174+
=item
157175
Should C<Num> be a synonym for C<num>/C<num64>?
158176

159-
=for item
177+
=item
160178
If the Int or Num type object is passed, should it be silently converted to a
161179
zero value, or cause an exception?
162180

163-
=for item
181+
=item
164182
How should overflows be handled?
165183

184+
=back
185+
166186
=head3 Strings
167187

168188
multi explicitly-manage(Str $x is rw, :$encoding = 'utf8') is export(:DEFAULT, :utils) { ... }
@@ -180,11 +200,16 @@ the caller or callee owns the data can't be decided automatically, and freeing
180200
by default risks causing later code to access freed memory.
181201

182202
Hypotheticals:
183-
=for item
203+
204+
=over
205+
206+
=item
184207
We need better facilities for signalling when it's appropriate to free data.
185208
The current facilities have the benefit that it won't cause memory-related
186209
errors later on, but on the flip side, it will leak memory over time.
187210

211+
=back
212+
188213
=head3 The C<OpaquePointer> class
189214

190215
class OpaquePointer is repr('CPointer') { }
@@ -276,6 +301,7 @@ One option is an API similar to the C99 C<stdarg.h> macros and explicitly get
276301
arguments off an opaque object. For example C<my $arg = va_arg($args, Type)>.
277302

278303
=head2 Miscellaneous helper functions
304+
279305
=head3 Refreshing outdated objects
280306

281307
multi refresh($obj) is export(:DEFAULT, :utils) { { ... }
@@ -290,7 +316,12 @@ the user will have to use C<refresh> to invalidate any outdated objects in the
290316
cache.
291317

292318
Hypotheticals:
293-
=for item
319+
320+
=over
321+
322+
=item
294323
Sometimes it will be necessary to reinterpret a pointer-valued object as a
295324
different kind of pointer. One way to provide this would be a function a la:
296325
C<my $val = reinterpret($ptr, Type)>.
326+
327+
=back

0 commit comments

Comments
 (0)