pdf-devel
[Top][All Lists]
Advanced

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

pdf_XXX_t variables creation (Was: [pdf-devel] time module unit test cas


From: jemarch
Subject: pdf_XXX_t variables creation (Was: [pdf-devel] time module unit test cases)
Date: Sun, 20 Apr 2008 17:23:32 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (powerpc-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

   Explaining a little bit deeper, for example glib (I am a glib fan)
   normally allocates the memory inside the functions and the user has
   to call the appropriate functions to free them, for example:

That is a good approach and we are using it in many of the pdf_xxx_t
"objects" in the library (such as pdf_stm_t or pdf_text_t).

To create a pdf_XXX_t variable you usually do:

pdf_XXX_t myxxx;

myxxx = pdf_xxx_new (parameters...);

and then, in order to dispose any used resources:

pdf_xxx_destroy (myxxx);

That schema works for both pointers and structures (heap or stack
memory) and the details are not exposed to the user.

I will change the implementation of both pdf_list and pdf_hash to
follow that convention.





reply via email to

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