Re: [LAD] c/jack question

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-audio-dev@...>
Date: Sunday, April 8, 2012 - 4:49 pm

> 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@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] c/jack question, Egor Sanin, (Sun Apr 8, 4:36 pm)
Re: [LAD] c/jack question, Mark McCurry, (Sun Apr 8, 4:49 pm)
Re: [LAD] c/jack question, Egor Sanin, (Sun Apr 8, 5:02 pm)
Re: [LAD] c/jack question, Gabriel M. Beddingfield, (Sun Apr 8, 5:43 pm)
Re: [LAD] c/jack question, Egor Sanin, (Sun Apr 8, 10:49 pm)
Re: [LAD] c/jack question, Dennis Schulmeister, (Sun Apr 8, 5:21 pm)