Re: gobject clarification regards to instance memory initialisation
- From: Tim Janik <timj gtk org>
- To: Stefan Kost <kost imn htwk-leipzig de>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: gobject clarification regards to instance memory initialisation
- Date: Thu, 28 Oct 2004 01:20:47 +0200 (CEST)
On Mon, 25 Oct 2004, Stefan Kost wrote:
hi hi,
I am currently updating the gobject tutorial from mathieu lacage again.
One question for the gurus' (I was scanning the code, but are not sure about
this). Frim the viewpoint of a class writer, do I have to initialise fields in
my object instance that should be 0/NULL or is the memory cleared?
In other words in my class_init/instance_init methods can I expect that
instance->XX
object->>XX
fields are 0 (except the parent fields of course)?
new class structures are zero initialized and pre-filled with the contents
of the parent class. instance structures and instance private data is
zero initialized.
however, it is a good habit to initialize all fields explicitely, getting used to this
comes in handy if you switch to other languages like C++ which don't do automatic
zero initialization.
Stefan
--
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]