[Vala] valgrind or something similar

2010-09-26 Thread august

Hi,

I'm new to the reference counting way of glib.  I'm also a little
worried about the weak and unowned keywords.  After reading the docs,
I'm still a bit confused.  

Is there something like a valgrind or method for debugging memory
leaks and mismanagement?

thanks -august.

___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] valgrind or something similar

2010-09-26 Thread Fabian Deutsch
Hey August,

Am Sonntag, den 26.09.2010, 20:18 +0200 schrieb august:
   Is there something like a valgrind or method for debugging memory
   leaks and mismanagement?

Something that helped me in real life (tm) was using nemiver and
watching the ref_count field of Object derived classes.

You need to compile the vala files using the -g flag, to be able to use
nemiver (a gdb gui).

Greetings
- fabian


smime.p7s
Description: S/MIME cryptographic signature
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] [ANNOUNCE] Libgee 0.6.0 - GObject collection library

2010-09-26 Thread Jürg Billeter
We are very pleased to announce version 0.6.0 of Libgee, the GObject 
collection library.

Libgee 0.6.0 is now available for download at:
http://download.gnome.org/sources/libgee/0.6/


Also please note that Libgee has its own mailing-list
http://mail.gnome.org/mailman/listinfo/libgee-list
and its own #gee IRC channel.


New in 0.6.0


 * Fix compiler warning.


For more information about the 0.5/0.6 release series, see:
http://live.gnome.org/Libgee/NewAndNoteworthy-0.5
http://live.gnome.org/Libgee/Migration-0.5


Libgee is a collection library providing GObject-based interfaces and 
classes for commonly used data structures.

Libgee provides the following interfaces:

 * Iterable
   o Collection
 + List
 + Set
 + MultiSet
 + Queue
   # Deque
 * Iterator
 * Map
 * MultiMap

The ArrayList, HashSet, HashMap, HashMultiSet, HashMultiMap, LinkedList, 
PriorityQueue, TreeSet, TreeMap, TreeMultiSet, and TreeMultiMap classes 
provide a reasonable sample implementation of those interfaces. In 
addition, a set of abstract classes are provided to ease the 
implementation of new collections.

Around that, the API provide means to retrieve read-only views, 
efficient sort algorithms, simple, bi-directional or index-based mutable 
iterators depending on the collection type.

Libgee is written in Vala and can be used like any GObject-based C 
library. It's planned to provide bindings for further languages.


More information about Libgee is available at

 http://live.gnome.org/Libgee


Jürg Billeter

___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] valgrind or something similar

2010-09-26 Thread Aleksander Wabik
Hi,

   Is there something like a valgrind or method for debugging memory
   leaks and mismanagement?

valgrind will work for vala programs, you just have to use it as with
glib programs - set G_DEBUG=gc_friendly, G_SLICE=always_malloc.

best regards,

-- 
Mój klucz publiczny o identyfikatorze 1024D/E12C5A4C znajduje się na
serwerze hkp://keys.gnupg.net

My public key with signature 1024D/E12C5A4C is on the server
hkp://keys.gnupg.net


signature.asc
Description: PGP signature
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Two small new features

2010-09-26 Thread Frederik Sdun
* Jürg Billeter j...@bitron.ch [25.09.2010 18:22]:
 Hi Frederik,
 
 On Sat, 2010-09-25 at 17:20 +0200, Frederik Sdun wrote:
  i just pushed two little patches to [0] which allows to add an else
  statement to foreach and catch statements.
  For foreach, the else block is called if there is no iteration in the
  loop.
  For the catch clause, the else block is called if no exception was
  caught and before the finally statement.
  
  Here are 2 little examples:
  foreach:
  void print_array (string[] args) {
  foreach (var arg in args) {
  debug(@arg: $arg);
  } else {
  debug(no args); //called if the array is empty
  }
  }
  void main (string[] args)
  {
  string[] test_1 = new string[0];
  string[] test_2 = new string[2]{hello, world};
  print_array (test_1);
  print_array (test_2);
  }
 
 The `else` seems to indicate that the code in the else block is reached
 if the foreach is not successful. However, zero iterations are by no
 means an unusual condition. In general, I'd like to keep (control flow)
 statements relatively simple as, in my opinion, it's ok that the code
 gets more complex when the control flow is more complex. You don't want
 to hide complex control flow.
 
This is just for convinience, for the not unusual case of:
if (args.length  0)
foreach(...)
else
...
  catch:
  public errordomain TestError {
  FOO,
  }
  public void throw_error (bool t) throws TestError {
  if (t) {
   throw new TestError.FOO(foo);
  }
  }
  void test(bool t) {
  try { 
  throw_error (t);
  } catch (TestError e) {
  debug(error :();
  } else {
  debug(success :));
  } finally {
  debug(finally);
  }
  }
  void main(){
  debug(false:);
  test(false);
  debug(true:);
  test(true);
  }
 
 What is the difference to the following?
 
 try {
 throw_error (t);
 debug (success :));
 } catch (TestError e) {
 debug(error :();
 } finally {
 debug(finally);
 }


You are outside of the try block, which allows you to throw exceptions,
which should be handled in an outer scope.

  P.S.: There's a another branch, which supports async delegates/lambdas at 
  [1]
  which requires some testing/reviewing.
 
 I definitely like that one. I'll try to review it as soon as possible.
 
 Thanks,
 Jürg
 

-- 
IRC: playya @ Freenode, Gimpnet
xmpp: pla...@draugr.de
identi.ca: playya


signature.asc
Description: Digital signature
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Vala - Clutter bindings

2010-09-26 Thread Jonathan Ryan



I submitted a patch or two. I think it works. I've been using it.
https://bugzilla.gnome.org/show_bug.cgi?id=630679

Jonathan Ryan

___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list