From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12970 invoked by alias); 19 May 2005 06:59:53 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 12888 invoked from network); 19 May 2005 06:59:44 -0000 Received: from unknown (HELO wproxy.gmail.com) (64.233.184.193) by sourceware.org with SMTP; 19 May 2005 06:59:44 -0000 Received: by wproxy.gmail.com with SMTP id 69so509300wri for ; Wed, 18 May 2005 23:59:44 -0700 (PDT) Received: by 10.54.65.13 with SMTP id n13mr209141wra; Wed, 18 May 2005 23:59:44 -0700 (PDT) Received: by 10.54.2.32 with HTTP; Wed, 18 May 2005 23:59:44 -0700 (PDT) Message-ID: <122f8500050518235962e0efc8@mail.gmail.com> Date: Thu, 19 May 2005 10:57:00 -0000 From: Balasaravanan P Reply-To: Balasaravanan P To: Balasaravanan P , ecos-discuss@sources.redhat.com In-Reply-To: <122f850005051122081daf5e71@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <122f850005051023046ec45ca3@mail.gmail.com> <20050511204245.GX31731@lunn.ch> <122f850005051122081daf5e71@mail.gmail.com> Subject: Re: [ECOS] Using standard malloc() X-SW-Source: 2005-05/txt/msg00251.txt.bz2 FYI, The problem I faced was not due the configuration. The Doug Lea's malloc implementation which I was using failed to allocate memory because one of its variable "remainder_size" was declared "long" which probably should have been "unsigned long" due to this a condition to check for the top fails always since the address which it checks was showing a negative. When it was made "unsigned long" malloc works fine. Thanks and Regards, Bala. On 5/12/05, Balasaravanan P wrote: > Hi Andrew, >=20 > Thanks for the reply. >=20 > I am using MIPS 4kc processor. > I also tried enabling "CYGBLD_ISO_MALLOC_HEADER" but could give correct v= alue. >=20 > I have pasted the ecosconfig export ecm file below. >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > cdl_savefile_version 1; > cdl_savefile_command cdl_savefile_version {}; > cdl_savefile_command cdl_savefile_command {}; > cdl_savefile_command cdl_configuration { description hardware template > package }; > cdl_savefile_command cdl_package { value_source user_value > wizard_value inferred_value }; > cdl_savefile_command cdl_component { value_source user_value > wizard_value inferred_value }; > cdl_savefile_command cdl_option { value_source user_value wizard_value > inferred_value }; > cdl_savefile_command cdl_interface { value_source user_value > wizard_value inferred_value }; >=20 > cdl_configuration eCos { > description "" ; > hardware mips32_4kc ; > template kernel ; > package -hardware CYGPKG_HAL_MIPS v2_0 ; > package -hardware CYGPKG_HAL_MIPS_MIPS32 v2_0 ; > package -hardware CYGPKG_HAL_MIPS v2_0 ; > package CYGPKG_HAL v2_0 ; > package CYGPKG_IO v2_0 ; > package CYGPKG_IO_SERIAL v2_0 ; > package CYGPKG_INFRA v2_0 ; > package CYGPKG_KERNEL v2_0 ; > package CYGPKG_ERROR v2_0 ; > package CYGPKG_MEMALLOC v2_0 ; > package CYGPKG_ISOINFRA v2_0 ; > }; >=20 > cdl_option CYGFUN_HAL_COMMON_KERNEL_SUPPORT { > user_value 1 > }; >=20 > cdl_option CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK { > user_value 0 > }; >=20 > cdl_option CYGHWR_HAL_MIPS_MIPS32_CORE { > user_value 4Kc > }; >=20 > cdl_component CYGSEM_KERNEL_SCHED_TIMESLICE { > user_value 1 > }; >=20 > cdl_component CYGPKG_KERNEL_INSTRUMENT { > user_value 0 > }; >=20 > cdl_option CYGDBG_KERNEL_INSTRUMENT_SMP { > user_value 0 > }; >=20 > cdl_component CYGDBG_KERNEL_INSTRUMENT_MSGS { > user_value 0 > }; >=20 > cdl_option CYGSEM_MEMALLOC_ALLOCATOR_FIXED_THREADAWARE { > user_value 0 > }; >=20 > cdl_option CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_THREADAWARE { > user_value 0 > }; >=20 > cdl_option CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_COALESCE { > user_value 0 > }; >=20 > cdl_option CYGBLD_MEMALLOC_MALLOC_IMPLEMENTATION_HEADER { > user_value > }; >=20 > cdl_option CYGIMP_MEMALLOC_MALLOC_VARIABLE_SIMPLE { > user_value 0 > }; >=20 > cdl_option CYGIMP_MEMALLOC_MALLOC_DLMALLOC { > user_value 1 > }; >=20 > cdl_option CYGBLD_ISO_ERRNO_CODES_HEADER { > inferred_value 1 > }; >=20 > cdl_option CYGBLD_ISO_ERRNO_HEADER { > inferred_value 1 > }; >=20 > cdl_option CYGBLD_ISO_RAND_HEADER { > user_value 0 0 > }; >=20 > cdl_option CYGBLD_ISO_MALLOC_HEADER { > user_value 0 0 > }; >=20 > cdl_option CYGBLD_ISO_STDLIB_SYSTEM_HEADER { > user_value 0 0 > }; >=20 > cdl_option CYGBLD_ISO_STRERROR_HEADER { > inferred_value 1 > }; >=20 >=20 > Best Regards, > Bala. >=20 >=20 > On 5/12/05, Andrew Lunn wrote: > > On Wed, May 11, 2005 at 11:34:30AM +0530, Balasaravanan P wrote: > > > Hi, > > > > > > I am writing an abstraction layer for an existing application this > > > requires me to use malloc to create threads. > > > > > > I tried using the standard LIBC malloc which returns NULL. I tried > > > printing the mallinfo structure and it shows 0 for all its members. > > > > > > Is there any other way to use standard malloc or am I missing any > > > configuration steps. > > > > You are missing something somewhere. malloc should work. What is the > > target and the configuration? Do an ecosconfig export and post the > > result. > > > > Andrew > > > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss