Re: possible bug?
- From: "dou wen" <orbkernel hotmail com>
- To: michael ximian com
- Cc: orbit-list gnome org
- Subject: Re: possible bug?
- Date: Sat, 09 Mar 2002 13:48:39 +0800
Hi, Michael
>From: Michael Meeks <michael@ximian.com>
>To: dou wen <orbkernel@hotmail.com>
>CC: orbit <orbit-list@gnome.org>
>Subject: Re: possible bug?
>Date: 08 Mar 2002 22:44:49 +0000
>
> Sorry it took you a while to find that - I hit this before and it's a
>pain.
So pain :-(
It's my pleasure :-)
> The problem with this is that it's incredibly slower than a simple
>ALIGN_VALUE.
oh,I see.
>The best solution is (I think) to have a wrapper for your
>malloc ( specific to the GIOP allocation code ) that ensures that the
>memory is 8 byte aligned - but we do need that assertion, could you
>knock up a simple patch (and comment) for that vs HEAD ORBit2 ?
>
Sure, here is my patch, but do not know if it is suitable.:-)
best regards
dou wen
_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger:
http://messenger.microsoft.com/cn
diff -Naur ORBit2-2.3.103/src/orb/GIOP/giop-recv-buffer.c
ORBit2-2.3.103-fix/src/orb/GIOP/giop-recv-buffer.c
--- ORBit2-2.3.103/src/orb/GIOP/giop-recv-buffer.c Mon Jan 14 23:59:51 2002
+++ ORBit2-2.3.103-fix/src/orb/GIOP/giop-recv-buffer.c Sat Mar 9 13:38:10
2002
@@ -828,8 +828,15 @@
if (!is_auth && (buf->msg.header.message_size >
GIOP_INITIAL_MSG_SIZE_LIMIT))
return TRUE;
-
- buf->message_body = g_malloc (buf->msg.header.message_size + 12);
+ /*
+ * FIXME: we assume the alignment is always 8 bytes, surely this will
speed up
+ * the demarshal operations,but in some platforms and situations, the
"malloc"
+ * result is not 8 bytes aligned,this will result in mismatch in offset
when
+ * decoding, so here we make sure the buf->message_body is always 8 bytes
aligned.
+ */
+
+ buf->message_body = (gpointer)ALIGN_VALUE(g_malloc
(buf->msg.header.message_size + 12 + 8), 8 );
+
buf->free_body = TRUE;
buf->cur = buf->message_body + 12;
buf->end = buf->cur + buf->msg.header.message_size;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]