From f88d4f76f69f52918726eb91a2ce06a163cbf0c6 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sat, 3 Nov 2012 12:51:19 +0100 Subject: queue: remove unnecessary (obj_t*) redirection from msg ptrs --- runtime/msg.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'runtime/msg.c') diff --git a/runtime/msg.c b/runtime/msg.c index b0b93f98..781743ae 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -3676,12 +3676,10 @@ static rsRetVal msgConstructFinalizer(msg_t *pThis) * satisfies the base object class getSeverity semantics. * rgerhards, 2008-01-14 */ -static rsRetVal -MsgGetSeverity(obj_t_ptr pThis, int *piSeverity) +rsRetVal +MsgGetSeverity(msg_t *pMsg, int *piSeverity) { - ISOBJ_TYPE_assert(pThis, msg); - assert(piSeverity != NULL); - *piSeverity = ((msg_t*) pThis)->iSeverity; + *piSeverity = pMsg->iSeverity; return RS_RET_OK; } @@ -3982,7 +3980,6 @@ BEGINObjClassInit(msg, 1, OBJ_IS_CORE_MODULE) OBJSetMethodHandler(objMethod_SERIALIZE, MsgSerialize); OBJSetMethodHandler(objMethod_SETPROPERTY, MsgSetProperty); OBJSetMethodHandler(objMethod_CONSTRUCTION_FINALIZER, msgConstructFinalizer); - OBJSetMethodHandler(objMethod_GETSEVERITY, MsgGetSeverity); /* initially, we have no need to lock message objects */ funcLock = MsgLockingDummy; funcUnlock = MsgLockingDummy; -- cgit v1.2.3 From c28d92259b27eebca3892b9ad18d467691e5aacc Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sat, 3 Nov 2012 13:27:27 +0100 Subject: queue: use specific deserializer for msg object spares lengthy table lookups --- runtime/msg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/msg.c') diff --git a/runtime/msg.c b/runtime/msg.c index 781743ae..b34adca3 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -3665,7 +3665,8 @@ finalize_it: * is done, the object is considered ready for full processing. * rgerhards, 2008-07-08 */ -static rsRetVal msgConstructFinalizer(msg_t *pThis) +rsRetVal +msgConstructFinalizer(msg_t *pThis) { MsgPrepareEnqueue(pThis); return RS_RET_OK; -- cgit v1.2.3 From 5a643669221363a49fb36cfb2acc64dc29b53a14 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sat, 3 Nov 2012 17:07:22 +0100 Subject: queue: remove time() calls from msg deserialization --- runtime/msg.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'runtime/msg.c') diff --git a/runtime/msg.c b/runtime/msg.c index b34adca3..dca49a6d 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -814,6 +814,19 @@ finalize_it: } +/* Special msg constructor, to be used when an object is deserialized. + * we do only the base init as we know the properties will be set in + * any case by the deserializer. We still do the "inexpensive" inits + * just to be on the safe side. The whole process needs to be + * refactored together with the msg serialization subsystem. + */ +rsRetVal +msgConstructForDeserializer(msg_t **ppThis) +{ + return msgBaseConstruct(ppThis); +} + + /* some free handlers for (slightly) complicated cases... All of them may be called * with an empty element. */ -- cgit v1.2.3