Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Real-Time Software Components (RTSC) » Memory.staticPlace() problem
Memory.staticPlace() problem [message #524156] Tue, 30 March 2010 23:51 Go to next message
Tomasz  is currently offline Tomasz Friend
Messages: 5
Registered: March 2010
Junior Member
Hello,

I'm working with xdc tools v3.16.03.36 and when I try to statically allocate object in my configuration file, I get an error during compilation:

Type Error: cannot find function $$alloc.

mycfg.cfg:
------------------------------------------------------------ ----------------------
var Memory = xdc.useModule("xdc.runtime.Memory");

s = new Array(1.2, 3.4);
Memory.staticPlace(s, 0, null);
------------------------------------------------------------ -----------------------
target: C67
platform: dsk6713

Thanks for any suggestions, how to use this function in meta-domain.
Re: Memory.staticPlace() problem [message #524390 is a reply to message #524156] Wed, 31 March 2010 18:59 Go to previous message
Sasha Slijepcevic is currently offline Sasha SlijepcevicFriend
Messages: 90
Registered: July 2009
Member
Tomasz,
the documentation for Memory.staticPlace does not state clearly that you can pass only typed array object as the first parameter.

When you specify:
s = new Array(1.2, 3.4);
Memory.staticPlace(s, 0, null);

you would expect that the result of that code is following C code:
const <SomeType> s = {1.2, 3.4};

However, from the config code above, it can't be determined what do you want the type of the elements in the array to be. Even if the type were determined somehow, you couldn't really access that array from your C code because 's' is just an XDCscript variable, which is not declared in any C file.

If in your XDC specification for module ModA, you have:
module ModA {
config Double[] s;
...
}

then in your configuration script, you could write:
ModA.s = [1.2, 3.4];
Memory.staticPlace(ModA.s, 0, null);

and then you access the array in your C code as Mod_s.
Previous Topic:Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Next Topic:Warning: xdc.cfg.INCOMPATIBLE_TARGET_VERSION
Goto Forum:
  


Current Time: Wed Nov 26 20:49:47 GMT 2014

Powered by FUDForum. Page generated in 0.02120 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software