Skip to main content



      Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » Memory.staticPlace() problem
Memory.staticPlace() problem [message #524156] Tue, 30 March 2010 19:51 Go to next message
Eclipse UserFriend
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 14:59 Go to previous message
Eclipse UserFriend
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 Jul 23 20:03:15 EDT 2025

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

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

Back to the top