Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: very simple specvecs
Home

[Freeciv-Dev] Re: very simple specvecs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: very simple specvecs
From: Jason Dorje Short <jdorje@xxxxxxxxxxxx>
Date: Sat, 15 May 2004 12:16:08 -0400

Vasco Alexandre Da Silva Costa wrote:

Just malloc a chunk and store the size before the beggining of the array.
Then return a pointer to the beggining of the array. To know the size,
access the memory before the pointer to the beggining. That should do what
you want.

But specvecs aren't malloced.  E.g. we have

  foo_vector foo;

  foo_vector_init(&foo);

rather than

  foo_vector foo = foo_vector_new();

jason


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