mirror of
https://github.com/rockchip-linux/mpp.git
synced 2024-11-27 03:54:00 +08:00
[rk_malloc]: add rk_malloc unit test for linux
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@28 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
parent
c0c5222152
commit
9606779e00
@ -17,6 +17,8 @@
|
||||
#ifndef __RK_MALLOC_H__
|
||||
#define __RK_MALLOC_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define rk_malloc(type, count) (type*)rk_mpp_malloc(sizeof(type) * (count))
|
||||
#define rk_free(ptr) rk_mpp_free(ptr)
|
||||
|
||||
|
29
osal/linux/os_malloc.c
Normal file
29
osal/linux/os_malloc.c
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2010 Rockchip Electronics S.LSI Co. LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "os_malloc.h"
|
||||
|
||||
int os_malloc(void **memptr, size_t alignment, size_t size)
|
||||
{
|
||||
return posix_memalign(memptr, alignment, size);
|
||||
}
|
||||
|
||||
void os_free(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user