[ECOS] malloc initialization problem

sensitron medical sensitronnet@yahoo.com
Tue Apr 1 21:55:00 GMT 2003

Forgot to mention that I am using ecos2.0. I am in the
process of testing 1.3.1.

My malloc does not fail if the size of the heap is
exceeded; I can malloc indefinitely. I traced this to
the constructor (see below), which is where I believe
the heap size is set (is this true?). Here's the
constructor for memvar.cxx instrumented with two
globals (caSize and caBase) that I can examine with an
emulator after the construtor executes:

// Constructor: gives the base and size of the arena
in which memory is
// to be carved out
cyg_int32 caSize = 0;
cyg_uint8 *caBase = 0;

    cyg_uint8 *base,
    cyg_int32 size,
    cyg_int32 alignment)
    : mypool( base, size, (CYG_ADDRWORD)alignment )
  caSize = size;
  caBase = base;

caSize is set to 33907992. I have no idea where it is
getting this number from since the size of the heap is

I say that the size of the heap is 16384 because I


I have tried both the simple variable allocator and
Doug Lea's allocator. They both have bogus sizes,
although they are not the same value.

Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more

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