[ros-dev] [ros-diffs] [dgorbachev] 38083: - Use HEAP_ZERO_MEMORY instead of memset(). - Do not crash if no adapter found.

Alex Ionescu ionucu at videotron.ca
Mon Dec 15 22:24:48 CET 2008


The in-line memset will be optimized by the compiler:

1) If it isn't needed, or if other code initializes the field to zero,  
the compiler will understand this
2) The zeroing itself will be more optimized inline code than what's  
present in the heap function
3) Register allocation will be optimized wrt. the zeroing and the  
actual function's code.

On 15-Dec-08, at 8:32 AM, Dmitry Gorbachev wrote:

> Hi,
>
> Alex Ionescu wrote:
>> You should always use memset and void HEAP_ZERO_MEMORY.
>
> Could you please tell why HEAP_ZERO_MEMORY should not be used?
>
> It is used in many places, so if something wrong with  
> RtlAllocateHeap, maybe
> better to fix it?
>
> Thanks,
> Dmitry
>
> _______________________________________________
> Ros-dev mailing list
> Ros-dev at reactos.org
> http://www.reactos.org/mailman/listinfo/ros-dev

Best regards,
Alex Ionescu



More information about the Ros-dev mailing list