Re: [LAD] c/jack question

From: Mark McCurry <mark.d.mccurry@email-addr-hidden>
Date: Sun Apr 08 2012 - 19:49:40 EEST

> Pardon the newb question, but why does: ...
This is a fairly simple C mistake.
In A, &pos refers to valid chunk of memory, thus when
jack_transport_query operates on it, it has a valid piece of memory to
work with.
In B, pos (IIRC) would be initialized to NULL as it is in the file scope.
So when you call jack_transport_query, you have provided a pointer to
NULL, where any memory access will be invalid.

If you set pos in B to be a pointer to a valid object (chunk of
memory) then it should work fine (ie refer to a global object or an
object allocated on the heap with malloc or friends).

--Mark
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Sun Apr 8 20:15:03 2012

This archive was generated by hypermail 2.1.8 : Sun Apr 08 2012 - 20:15:03 EEST