Re: list query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/4/8 Cédric Augonnet <cedric.augonnet@xxxxxxxxx>:
> 2010/4/8 Onkar Mahajan <kern.devel@xxxxxxxxx>:
>> What is LIST_POISON1 and LIST_POISON2  ??
>>
>> #define LIST_POISON1  ((void *) 0x00100100 + POISON_POINTER_DELTA)
>> #define LIST_POISON2  ((void *) 0x00200200 + POISON_POINTER_DELTA)
>>
>> and why they are used ?
>>
>> Regards,
>> Onkar
>>
>
> Hi Onkar,
>
> A "poison" value is a convenient value that you can detect when
> debugging. For instance if you find out that a pointer is 0xdeadbeef,
> you can easily imagine this is some uninitialized value. If you had
> used a NULL value, it would be harder to determine whether it's
> something uninitialized ...

yes... specially if it is some special value (like LIST_POISON1) in
the core and you can immediately go and look at the places where all
they get set and you can start from there.  Setting it to NULL or
something generic like 0xdeadbeef will make this hard.

thanks -
Manish

>
> Hope this helps,
> Cédric
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>



-- 
Thanks -
Manish
==================================
[$\*.^ -- I miss being one of them
==================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux