Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Curl Easy NativeCall
use NativeCall;
class Curl::Easy is repr( 'CPointer' ) {
sub curl_easy_init ( ) returns Curl::Easy is native( 'libcurl' ) { * };
sub curl_easy_cleanup ( Curl::Easy ) is native( 'libcurl' ) { * };
method new ( ) {
curl_easy_init();
}
submethod DESTROY {
say 'destroying';
curl_easy_cleanup( self );
}
};
loop { Curl::Easy.new };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment