pdf-devel
[Top][All Lists]
Advanced

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

[pdf-devel] Object Layer comments


From: Aleksander Morgado
Subject: [pdf-devel] Object Layer comments
Date: Tue, 09 Feb 2010 23:37:04 +0100

Hi Jose and all,

I don't quite understand the need of the Garbage Collector in the object
layer, when we already have the possibility of reference counting in
each PDF object. Why not just start refcount=1 when object is created
and fully dispose the object when its refcount arrives zero? When adding
an object into another one, we add a new reference of the object. Then,
when unrefing the parent object, we would unref each subobject, and
such. At the end, all references should get balanced, as done usually
with GObjects in GTK+.

Also, can't get the difference between `pdf_obj_destroy()' and
`pdf_obj_release()'. Isn't it true that an object will only get disposed
when its refcount arrives zero? If not, what for is the reference
counting in the PDF object?


And apart of the reference counting stuff, I believe there are some
errors in the API. Instead of:
 pdf_status_t
 pdf_obj_dict_set(pdf_obj_t dict, pdf_obj_t key, pdf_obj_t &val);
Shouldn't it be without the '&' in last arg?:
 pdf_status_t
 pdf_obj_dict_set(pdf_obj_t dict, pdf_obj_t key, pdf_obj_t val);

And in this case:
 pdf_status_t
 pdf_obj_dict_get(pdf_obj_t dict, pdf_obj_t key, pdf_obj_t &val);
Shouldn't it be with '*' instead of '&' in the last arg?:
 pdf_status_t
 pdf_obj_dict_get(pdf_obj_t dict, pdf_obj_t key, pdf_obj_t *val);

And same kind of errors in pdf_obj_dict_get_str(), pdf_obj_dict_set(),
pdf_obj_dict_set_str(), I believe.

I can prepare a patch for those API functions.

Cheers,
-Aleksander






reply via email to

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