[ee122] persistent structs

Daniel Killebrew dank at eecs.berkeley.edu
Sat Sep 22 03:11:29 PDT 2007


Where the structure is allocated doesn't matter, as long as you are 
using memory during its lifetime (for example, not using a pointer to a 
structure that was allocated on the stack frame of a function that was 
called and returned.)

So to answer your question, no.(Do any of these structs have to be 
persistent (aka on the heap)?  )

Daniel

Nescio Nomen wrote:
> Let's say for example that a call to bind looks like this:
>
> bind(sockfd, (struct sockaddr *) &sin, sizeof (sin))
>
> You have to make a struct at some point to feed the bind function.  
> This is true for many other network functions.  Do any of these 
> structs have to be persistent (aka on the heap)?  My guess is no but 
> it's hard to tell.  Most of the examples I've seen are short and the 
> code within a single function, such that the stack is never cleared 
> until everything is already done. 
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ee122 mailing list
> ee122 at mailman.ICSI.Berkeley.EDU
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/ee122
>   


More information about the ee122 mailing list