develooper Front page | perl.perl6.users | Postings from January 2021

Re: NativeCall -- size of data structure

Thread Previous
From:
Paul Procacci
Date:
January 3, 2021 01:04
Subject:
Re: NativeCall -- size of data structure
Message ID:
CAFbbPugp7B5i+iywWc2muW7yT+aM4CUt9N34nVZPigZTWh=cZQ@mail.gmail.com
Apologies.  I just came across it.

nativesizeof is the subroutine you're looking for.

Again, sorry for the noise.

~Paul


On Sat, Jan 2, 2021 at 7:58 PM Paul Procacci <pprocacci@gmail.com> wrote:

> Hey Gents,
>
> Hopefully a simple question that I could not find the answer to.
>
> Given the following:
>
> class PROCESSENTRY32 is repr('CStruct') {
>     has int32 $.dwSize;
>     has int32 $.cntUsage;
>     has int32 $.th32ProcessID;
>     has Pointer $.th32DefaultHeapID;
>     has int32 $.th32ModuleID;
>     has int32 $.cntThreads;
>     has int32 $.th32ParentProcessID;
>     has long $.pcPriClassBase;
>     has int32 $.dwFlags;
>     HAS Str @.szExeFile[260] is CArray;      # MAX_PATH on windows is 260
> };
>
>
> ... is there is a raku method that gives me the size of this data
> structure?
>
> In C for example one would use sizeof() to provide the size.  In raku I
> could not find the documentation that would provide this information.
>
> Thanks,
> Paul Procacci
> --
> __________________
>
> :(){ :|:& };:
>


-- 
__________________

:(){ :|:& };:

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About