Quantcast
Channel: Tools
Viewing all articles
Browse latest Browse all 91752

Forum Post: RE: Memset/Memcpy Suspected Issues

$
0
0

George,

yes, you were right, the struct has three uint64 members, so the compiler assumes it to be aligned to 8 bytes.

The problem in my case was that I have to copy the struct to a contiguous memory region in order to send it via ethernet. The function where I experienced the problem just takes a pointer to the next "free" position in this send-buffer. At the moment, we cannot guarantee any alignement of this buffer.

I resolved the problem by assembling the struct locally (on the stack) and copying (casting memcpy-parameters to (uint32*) ) it to the right place.

Thanks for your help,

Roman


Viewing all articles
Browse latest Browse all 91752

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>