instance$static$init not getting called [message #494024] |
Wed, 28 October 2009 15:57  |
Eclipse User |
|
|
|
I'd like to use XDCScript to statically initialize some target data structures that are associated with an instance of a module, but for some reason the .xs file's instance$static$init function is not getting called.
I've added print statements to the module's .xs script and can see both module$use() and module$static$init(obj) being called, but don't see instance$static$init,(obj, prms) being called.
I've tried setting the module's .common$.memoryPolicy = xdc.runtime.Types.STATIC_POLICY in both module$use and the application's .cfg file, and even tried setting the Defaults.common$.memoryPolicy = xdc.runtime.Types.STATIC_POLICY as well without any success.
My .xdc file has the following structure:
@InstanceFinalize /* this mod has cleanup fxn when instances are deleted */
@InstanceInitError /* instance create can fail */
...
module MsgQueue {
...
instance:
create();
... // instance config and function declarations
internal:
struct Instance_State {
... // instance state variables
};
}
I've tried adding @ModuleStartup to the .xdc file as well.
The module's .c code contains a <Mod>_Instance_Init function declaration.
I'm currently using xdctools 3.15.02.62
Any advice on what I should do to get the instance$static$init function in the module's .xs script to be called would be much appreciated.
Regards,
Brian
|
|
|
|
Re: instance$static$init not getting called [message #494236 is a reply to message #494033] |
Thu, 29 October 2009 12:54  |
Eclipse User |
|
|
|
Sasha ,
Your reply made me realize that I hadn't added a call to create the module instance to the application's .cfg file. Once I did that, everything worked.
Thanks for all your help!
Regards,
Brian
[Updated on: Thu, 29 October 2009 12:55] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02647 seconds