[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Flex 2.5.11 comments
From: |
John Millaway |
Subject: |
Re: Flex 2.5.11 comments |
Date: |
Sat, 10 Aug 2002 08:59:46 -0700 (PDT) |
> 3. yyalloc, yyrealloc, and yyfree are declared and
> called with an additional argument in reentrant
> scanners, but in no case is the additional argument
> used. It would be nice if these three were declared
> and called without the additional argument so as to
> be compatible with standard malloc, realloc, and free
> function calls (in case the user wants to redefine
> them).
This is for consistency's sake in the reentrant API. More importantly, it is
the only way to pass a custom allocator to these functions. For example, it can
be used with a pooled memory allocator, such as Apache's APR
(http://apr.apache.org/), in which the caller needs to pass a handle to the
desired memory pool. Without the additional argument, you'd need global
variables to pass information to the reentrant scanner... which is a no-no.
The default implementations of yyalloc, yyrealloc, and yyfree do not use the
additional argument because they are just wrappers around standard malloc,
realloc, and free.
-John
__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com