site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Thread-index: AcU/romlAGr7BSS2TJiw3ycRsWiMQAAAHeCw Thread-topic: Kernel stack size OK let me try it another way. I have this structure declared as global: Struct Frame_Data { void *buff1; void *buff2; void *buff3; } Then I declare as a global: Int g_Array_Cnt = 0; struct Frame_Data my_data[50]; So in my kernel's init routine I do: While(g_Array_Cnt < 50) { if((my_data[g_Array_Cnt].buff1 = _MALLOC(1600, M_TEMP, M_WAITOK)) != 0) { bzero(&my_data[g_Array_Cnt].buff1, 1600); if((my_data[g_Array_Cnt].buff2 = _MALLOC(1600, M_TEMP, M_WAITOK)) != 0) { bzero(&my_data[g_Array_Cnt].buff2, 1600); if((my_data[g_Array_Cnt].buff3 = _MALLOC(1600, M_TEMP, M_WAITOK)) != 0) { bzero(&my_data[g_Array_Cnt].buff3, 1600); } else // error handling } else // error handling } else // error handling g_Array_Cnt++; } As I was saying g_Array_Cnt will go up to 10, go through the first _MALLOC for buff1, then in poof, g_Array_Cnt becomes 0 and the process will keep looping, from 0 to 10. Does that make it clearer? Carl -----Original Message----- From: Justin Walker [mailto:justin@mac.com] Sent: Tuesday, April 12, 2005 6:26 PM To: Carl Smith Subject: Re: Kernel stack size And, right away, I take it off-list :-} On Apr 12, 2005, at 15:09, Carl Smith wrote:
To be more precise I had a global array with three pointers in it to char* buffers. i.e char* buf1, char* buf2 and so on.
I set the global array at a size of 50. So I had a 50 structures contain my three char pointers.
I'm having trouble reading the above. It's not quite english :-}. Maybe you need to put a governor on your brain, so it doesn't outrun your fingers :-}. Cheers, Justin -- Justin C. Walker, Curmudgeon-At-Large Institute for General Semantics -------- If you're not confused, You're not paying attention -------- _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Carl Smith