On 2014-08-20 6:01 AM, blake kim wrote:
extern(C) align(1) struct epoll_event {
align(1):
uint events;
epoll_data_t data;
}
Wow, that fixes my issue! I couldn't use more than 1 event in my array
because of misalignment, thanks!
I am a newbie on D and studying interfacing to C API.
I found abnormal work of epoll_wait.
I stored an arbitrary 64bit number to u64 of epoll_event and
registered the event with valid fd using epoll_ctl.
When the fd is activated on EPOLLIN, I found u64 value is not
normal.
epoll has lost
On Wednesday, 20 August 2014 at 06:11:42 UTC, blake kim wrote:
But I don't think this is right. Many C APIs need structure as
argument and adjusting align each structure doesn't make sense.
Is this problem a Bug of D ?
Default alignment in D is pointersize (size_t) - so 8 on 64bit.
But most C
On Wednesday, 20 August 2014 at 06:17:43 UTC, Dominikus Dittes
Scherkl wrote:
On Wednesday, 20 August 2014 at 06:11:42 UTC, blake kim wrote:
But I don't think this is right. Many C APIs need structure as
argument and adjusting align each structure doesn't make sense.
Is this problem a Bug of
On Wednesday, 20 August 2014 at 07:02:52 UTC, blake kim wrote:
On Wednesday, 20 August 2014 at 06:17:43 UTC, Dominikus Dittes
Scherkl wrote:
On Wednesday, 20 August 2014 at 06:11:42 UTC, blake kim wrote:
But I don't think this is right. Many C APIs need structure
as argument and adjusting
On Wed, 20 Aug 2014 10:01:05 +
blake kim via Digitalmars-d digitalmars-d@puremagic.com wrote:
fill bugreport, please. and submit PR if you can.
signature.asc
Description: PGP signature
blake kim wrote in message news:slmejjrekoahgbmti...@forum.dlang.org...
In my investigation, this problem appears by memory align mismatch.
In C, sizeof(epoll_event) is 12 but D tells this is
16.(epoll_event.sizeof)
With default alignment, the D layout must match the C layout. I've fun a