[Speex-dev] Re: os_support.h, libc overrides
jean-marc.valin at usherbrooke.ca
Fri Dec 7 13:55:02 PST 2007
Thanks for the patch. As usual, there's some CRLF issues I can't figure
out. Could you send a zip containing the files you changed?
Jim Crichton a écrit :
> Attached is a patch (to build 14264) to fix the TI DSP builds with the
> recent restructuring of libspeex. The change adds a hook in
> os_support.h to allow the user to override some memory allocation and
> I/O functions. A similar hook was present in misc.c, but was lost when
> that file was removed. Also, the size of the private memory allocation
> area has been reduced, to match improvements in Speex memory utilization.
> In this patch, the memory override functions are implemented as inline
> functions, which increases the code size by about 0.5kB in the test
> builds. This could be reduced by moving the guts of the routines to a
> separate C file, and reducing the inline functions to just call those
> routines. I have not had time to test that approach, but the present
> patch is sufficient to get the build working again.
> Also, ti/user_misc.h should be replaced by the similar
> ti/os_support_custom.h file, which is also attached.
> I remember your having some trouble reading my patches (from Tortoise
> SVN) before, so let me know if I need to format this differently for you
> to use it. Sorry if this was holding you up.
> - Jim
> ----- Original Message ----- From: "Jim Crichton"
> <jim.crichton at comcast.net>
> To: "Jean-Marc Valin" <jean-marc.valin at usherbrooke.ca>
> Cc: <speex-dev at xiph.org>
> Sent: Tuesday, November 06, 2007 1:35 PM
> Subject: os_support.h, libc overrides
>>> That reminds me that I've just moved lots of stuff around with the
>>> allocation functions. Can you check that the TI stuff still works with
>>> that? In the end, it'll probably make things easier for you now. For
>>> example, if you link statically, wideband should be automatically left
>>> out if unused. Also, all the libc stuff is now in os_support.h, which is
>>> less messy than misc.h/misc.c were.
>> The TI C64x build produces bit-exact results with build 12825 (April
>> 2007, a bit before 1.2beta2). The C54x and C55x builds did not work
>> because the manual allocation scheme was broken when misc.c was removed.
>> The old override mechanism was:
>> 1. Define USER_MISC in config.h
>> 2. In, misc.c, include user_misc.h if USER_MISC is defined
>> 3. Put the allocation override code in user_misc.h.
>> The result is that the override code is included in one source file
>> (misc.c), so there are no duplicate definitions. How would you like
>> to see this implemented under the current structure? Including the
>> override functions in os_support.h does not work unless the overrides
>> are also static inlines (otherwise duplicate definitions occur). For
>> code size efficiency, it would be nice if these functions were not
>> required to be static inline.
>> The function prototypes were removed from misc.h, so now they are
>> defined nowhere when overrides are defined. There is no way around
>> that without some change to the source.
>> What do you think?
>> - Jim
More information about the Speex-dev