help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I plug-in my own memory management in Bison?


From: Hans Aberg
Subject: Re: How can I plug-in my own memory management in Bison?
Date: Wed, 22 Aug 2012 15:47:43 +0200

On 13 Aug 2012, at 16:02, Ashish Mahamuni wrote:

> I have got my own "my_malloc" and "my_free" methods.
> I would like Bison to invoke those for memory allocation and to free the
> memory.
> 
> Basically, something similar to lex, where I can specify noyyalloc,
> noyyfree and provide my own definitions.
> 
> I tried #define YYMALLOC, but it did not work.
> 
> is this possible with Bison?

Looking into the parser file, it defines macros YYSTACK_ALLOC and YYSTACK_FREE, 
which should be possible to set. However, they are not documented, making it a 
fragile hack.

Akim and Paul, should this not be a supported feature?

Hans





reply via email to

[Prev in Thread] Current Thread [Next in Thread]