[erlang-questions] REF: native pointer size query (URGENT)

Kenneth Lundin <>
Mon Dec 15 09:09:24 CET 2008


You can call
erlang:system_info(wordsize) which gives you the wordsize in bytes.
The wordsize is the same as the pointer size.

/Kenneth Erlang/OTP Ericsson

On Sun, Dec 14, 2008 at 8:29 PM, David KOCH <> wrote:
> I'm looking forward a way to know, erlang side,
> the size and type of a pointer. Understand if
> running on a 32 bits big endian machine, have
> a macro that gives me the correct size of the
> pointer :
>
> -ifdef(32BITS).
>    -define(_PTR, 32/unsigned-native).
> -else.
>    -define(_PTR, 64/unsigned-native).
> -endif.
>
> http://www.erlang.org/documentation/doc-5.6/doc/programming_examples/bit_syntax.html
>
> The endianness can be set to 'native', resolved
> at load time, but I also need to know the size
> of the data.
>
> Thanks...
>
> --
> KOCH David - http://www.kochise.com/
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list