2015-08-05 10:15:38 +08:00
|
|
|
/*
|
2016-06-13 17:42:31 +08:00
|
|
|
* Copyright 2015 Rockchip Electronics Co. LTD
|
2015-08-05 10:15:38 +08:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2015-08-13 17:15:31 +08:00
|
|
|
#define MODULE_TAG "mpp_mem_test"
|
2015-08-07 17:00:27 +08:00
|
|
|
|
|
|
|
#include "mpp_log.h"
|
|
|
|
#include "mpp_env.h"
|
2015-08-07 18:15:24 +08:00
|
|
|
#include "mpp_mem.h"
|
2015-08-05 10:15:38 +08:00
|
|
|
|
2015-08-07 14:28:41 +08:00
|
|
|
// TODO: need to add pressure test case and parameter scan case
|
|
|
|
|
2015-08-05 10:15:38 +08:00
|
|
|
int main()
|
|
|
|
{
|
2015-08-07 18:32:18 +08:00
|
|
|
void *tmp = NULL;
|
|
|
|
|
2015-08-13 17:30:27 +08:00
|
|
|
tmp = mpp_calloc(int, 100);
|
2015-08-05 10:15:38 +08:00
|
|
|
if (tmp) {
|
2015-08-13 17:30:27 +08:00
|
|
|
mpp_log("calloc success ptr 0x%p\n", tmp);
|
2015-08-05 10:15:38 +08:00
|
|
|
} else {
|
2015-08-13 17:30:27 +08:00
|
|
|
mpp_log("calloc failed\n");
|
2015-08-05 10:15:38 +08:00
|
|
|
}
|
2015-08-13 17:15:31 +08:00
|
|
|
if (tmp) {
|
|
|
|
tmp = mpp_realloc(tmp, int, 200);
|
|
|
|
if (tmp) {
|
|
|
|
mpp_log("realloc success ptr 0x%p\n", tmp);
|
|
|
|
} else {
|
|
|
|
mpp_log("realloc failed\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mpp_free(tmp);
|
|
|
|
mpp_log("mpp_mem_test done\n");
|
2015-08-05 10:15:38 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|