RTL memory functions

Source: Internet
Author: User
Void rtl_test () {const int bufsize = 1024; uchar * pbuf1 = (uchar *) exallocatepool (pagedpool, bufsize ); // allocate memory kdprint ("allocated memory address pbuf1 = % 08x", pbuf1); uchar * pbuf2 = (uchar *) exallocatepool (pagedpool, bufsize ); // allocate memory kdprint ("allocated memory address pbuf2 = % 08x", pbuf2); rtlzeromemory (pbuf1, bufsize ); // kdprint ("initializing the memory address pbuf1 = % 08x to 0", pbuf1); rtlfillmemory (pbuf2, bufsize, 0xaa ); // memory filling: 0 xaakdprint ("fill the memory address pbuf2 = % 08x with 0xaa", pbuf2); If (bufsize = rtlcomparememory (pbuf1, pbuf2, bufsize )) // memory comparison {kdprint ("memory % 08x is equal to memory % 08x", pbuf1, pbuf2 ));} else {kdprint ("memory % 08x and memory % 08x are not equal", pbuf1, pbuf2);} rtlcopymemory (pbuf2, pbuf1, bufsize ); // memory copy kdprint ("copy the memory address pbuf1 = % 08x to the memory address pbuf2 = % 08x", pbuf1, pbuf2); rtlmovememory (pbuf2, pbuf1, bufsize ); // memory mobile kdprint ("Move the memory address pbuf1 = % 08x to the memory address pbuf2 = % 08x", pbuf1, pbuf2); If (bufsize = rtlcomparemory (pbuf1, pbuf2, bufsize) // memory comparison {kdprint ("memory % 08x equals memory % 08x", pbuf1, pbuf2 ));} else {kdprint ("memory % 08x and memory % 08x are not equal", pbuf1, pbuf2);} exfreepool (pbuf1); // release the memory exfreepool (pbuf2 );}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.