Lexer in D
monarch_dodra
monarchdodra at gmail.com
Mon Mar 11 09:03:28 PDT 2013
On Monday, 11 March 2013 at 15:56:37 UTC, Namespace wrote:
> On Monday, 11 March 2013 at 15:51:58 UTC, David wrote:
>>> But I do not think you can extend a memory block with C
>>> functions.
>>
>> What about realloc?
>
> That's what I use. But it moves your old memory into the new
> allocated. Or proves it first if your current memory block
> could be extended?
extends if possible.
http://dpaste.dzfl.pl/f86e5db6
import core.stdc.stdlib;
void main()
{
auto p1 = malloc(14);
auto p2 = realloc(p1, 15);
assert(p1 is p2);
}
More information about the Digitalmars-d-learn
mailing list