[ECOS] malloc vs. new
Scott Dattalo
scott@dattalo.com
Fri Jun 21 20:02:00 GMT 2002
In a project I'm porting to eCos there is some C++ code. Consequently,
there are several new() calls for creating new objects. Unfortunately,
calls to new() hang. Specifically, the kernel is unable to allocate memory
and throws an exception. This switches control to the exception thread and
control is never released...
Calls to malloc, OTOH, work just fine.
I've sifted through the documentation and the best I could come up with is
this snippet:
#define MEMORY_BUFFER 0x1000
char StaticMemoryBuffer[MEMORY_BUFFER];
...
cyg_handle_t mempool;
cyg_mempool_var mempool_obj;
cyg_mempool_var_create(StaticMemoryBuffer, MEMORY_BUFFER, &mempool,
&mempool_obj);
This still fails. How does one provide a memory allocation buffer for
new()?
Scott
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss
mailing list