• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Kernel stack size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Kernel stack size


  • Subject: RE: Kernel stack size
  • From: "Carl Smith" <email@hidden>
  • Date: Tue, 12 Apr 2005 18:45:52 -0400
  • 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:email@hidden]
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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Kernel stack size
      • From: Nikita Danilov <email@hidden>
    • RE: Kernel stack size
      • From: William Kucharski <email@hidden>
    • RE: Kernel stack size
      • From: "Jamie Wood" <email@hidden>
  • Prev by Date: FW: Kernel stack size
  • Next by Date: RE: Kernel stack size
  • Previous by thread: FW: Kernel stack size
  • Next by thread: RE: Kernel stack size
  • Index(es):
    • Date
    • Thread