Re: How to use NativeCall with a libc function?

2016-04-03 Thread Timo Paulssen
When you have a sub that's not "our", it will not show up in the module's namespace. Since you export the sub, it'll be available without LIBCIO:: before its name. I suggest you pass Str (the String type object) instead of 'libc' for the native trait, as the symbol is pretty much guaranteed to alr

How to use NativeCall with a libc function?

2016-04-03 Thread Tom Browder
I have a module LIBCIO.pm6: unit module LIBCIO; use NativeCall; sub fopen(Str, Str) returns Pointer is native('libc') is export { * } I then try to use it in a Perl 6 sub: # try NativeCall use lib '.'; use LIBCIO; # get a file pointer my Str $mode = 'r'; my $fp = LIBCIO::fopen

Re: A practical benchmark shows speed challenges for Perl 6

2016-04-03 Thread Parrot Raiser
Perhaps the entity in the best position to figure out the optimum buffer size is the program itself. The information on file size, available memory, &c is there, so a calculation when the file is opened ought to yield the answer for best performance. On 4/2/16, yary wrote: > I think I understan