aligned_malloc and aligned_free
void * aligned_malloc(size_t bytes, size_t alignment);
void aligned_free(void * p);
aligned_malloc and aligned_free functions can use the C runtime
functions malloc and free in their implementation. aligned_malloc takes
the size of the buffer you would like to allocate and also alignment
which is guaranteed to be a power of 2 that will force the starting
address of the buffer you return to the user to start on an alignment
boundary. For example, I may request 1000 bytes starting on a 128 byte
boundary by calling aligned_malloc(1000, 128). aligned_free frees the
buffer returned from aligned_malloc.
Please make sure to implement the code independently and not refer to
the implementations available on the web.
안녕하세요. 위에 께 제가 받은 질문인데요,,,
한마디로 aligned_malloc 하고 aligned_free 를 코드 작성해야되는데,
인터넷에서 몇개 찾아봤는데, 잘 무슨 소리인지 모르겟어서,,
좀 자세한 설명과 코딩을 답해주셨으면 고맙겠습니다.
이렇게 막 질문한것에 양해 부탁드립니다...
고맙습니다~
숙제 해답을
숙제 해답을 인터넷에서 찾아보는 건 표절 아닌가요? 잘 모르겠으면 조교를 찾아가는 게 나을 것 같은데...
댓글 달기