[asterisk-dev] Problems with ast_realloc Version 1.4.5

Matthew Fredrickson creslin at digium.com
Mon Jun 25 17:16:38 CDT 2007


I am too, especially if it's not used anywhere.  The .text segment  
shouldn't be filled with unused code.

---
Matthew Fredrickson
Software Engineer
Digium, Inc.

On Jun 25, 2007, at 4:03 PM, Tilghman Lesher wrote:

> On Monday 25 June 2007 13:40, Russell Bryant wrote:
>> Matthew Fredrickson wrote:
>>> Alloca() does not allocate memory on the heap, like malloc() and
>>> friends.  It allocates memory on the stack.  That's why you can't
>>> realloc the pointer.
>>
>> However, I think we have an ast_realloca() somewhere, but the name is
>> quite deceiving.  It doesn't reallocate anything.  It just allocates
>> a new block on the stack and copies the data from the old buffer into
>> the new one.
>
> We have a struct ast_realloca and we have a macro defined to use it,
> called ast_restrdupa().  Given that nothing currently uses it and  
> given
> that it's rather wasteful of stack space, I'm for removing it.
>
> -- 
> Tilghman
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list