[erlang-questions] Passing data between Erlang and C port while preserving padding and alignment?

Sölvi Páll Ásgeirsson solvip@REDACTED
Sat Dec 8 00:11:34 CET 2018


Can you use #pragma pack on the C structs?
You can then easily deconstruct them in a binary match

Regards
Sölvi

Sent from my iPhone

> On 7 Dec 2018, at 21:02, Roger Lipscombe <roger@REDACTED> wrote:
> 
>> On Fri, 7 Dec 2018 at 18:02, Frank Muller <frank.muller.erl@REDACTED> wrote:
>> Thanks Mikael.
>> Any others thoughts ?
> 
> I'm assuming that you've considered serializing and deserializing the data to an unpadded (or defined padding) format, but that you've presumably discounted it for performance reasons?
> 
> Just putting it out there in case someone's facing a similar issue, but has different constraints.
> 
> We once used XDR for this (with some kind of IDL-to-C converter, if I recall correctly). Some brief googling suggests that XDR is not dead yet.
> 
> Cheers,
> Roger.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181207/e0fa5f56/attachment.htm>


More information about the erlang-questions mailing list