Re: circular log buffer
Re: circular log buffer
- Subject: Re: circular log buffer
- From: Joel Reymont <email@hidden>
- Date: Wed, 1 Dec 2010 10:26:08 +0000
On Dec 1, 2010, at 12:13 AM, Marc Majka wrote:
> What OS version is this on, and how much is getting logged?
10.6.4 I think.
> If it's sufficient to maintain a circular queue of messages internal to your app, you could allocate an array of aslmsg structures:
This would be my preferred option.
> asl_circular_queue = (aslmsg *)calloc(CIRCULAR_QUEUE_SIZE, sizeof(aslmsg));
>
> and use asl_new() / asl_set() to make messages. Then hold them in the array
>
> asl_circular_queue[cursor] = new_msg;
> cursor = (cursor + 1) % CIRCULAR_QUEUE_SIZE;
Do I need to asl_new/asl_free for every asl_set or can a message allocated with asl_new be reused multiple times?
Thanks, Joel
---
http://twitter.com/wagerlabs
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden