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

NativeCall -- size of data structure

Thread Next
From:
Paul Procacci
Date:
January 3, 2021 00:58
Subject:
NativeCall -- size of data structure
Message ID:
CAFbbPugQURhXd521QjdV34KYpBk2A=OYL91_90tjJPcE6c1AKQ@mail.gmail.com
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 Next


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