📄 app_mem_config.h
字号:
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* app_mem_config.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* Register application-based ASM
*
* Note: screen-based ASM is registered in ScrMemMgr.h because it belongs to MMI
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef APP_MEM_CONFIG_H
#define APP_MEM_CONFIG_H
#ifdef __J2ME__
#include "j2me_custom_param.h"
#endif
#ifndef APP_MEM_H
#error "Please include app_mem.h before this file"
#endif
#ifndef APP_MEM_C
/* This file may include application header files in other folders,
and modules other than applib may not have the appropriate include paths.
It is easy to have compile errors. */
#error "app_mem_config.h can only be included in app_mem.c"
#endif /* APP_MEM_C */
#ifndef __MMI_FEATURES__
#include "mmi_features.h"
#endif
/*
* WARNING!!!
* After modifying this file, please notify the file owner to review your changes.
*/
/* APPMEM_POOL_SIZE is multiple of 4 */
#define APPMEM_POOL_SIZE (0)
#ifdef APPLIB_MEM_UNIT_TEST
#define APPMEM_TEST_POOL_SIZE (100*1024)
#if APPMEM_TEST_POOL_SIZE > APPMEM_POOL_SIZE
#undef APPMEM_POOL_SIZE
#define APPMEM_POOL_SIZE APPMEM_TEST_POOL_SIZE
#endif
#endif /* APPLIB_MEM_UNIT_TEST */
#ifdef __MMI_3D_GAME__
#ifdef GE_BROGENT
#include "bgl_adaptation.h"
#if BGL_BUFFER_POOL_SIZE > APPMEM_POOL_SIZE
#undef APPMEM_POOL_SIZE
#define APPMEM_POOL_SIZE BGL_BUFFER_POOL_SIZE
#endif
#endif /* GE_BROGENT */
#endif /* __MMI_3D_GAME__ */
#ifdef __MMI_BARCODEREADER__
#if !defined(MMI_ON_WIN32)
#ifndef MMI_ON_HARDWARE_P
#define MMI_ON_HARDWARE_P
#endif
#endif
#include "lcd_sw_rnd.h"
#include "PixtelDataTypes.h"
#include "gdi_include.h"
#include "barcodereaderGprot.h"
#define APPMEM_BARCODEREADER_POOL_SIZE
#if BR_APP_TOTAL_SIZE > APPMEM_POOL_SIZE
#undef APPMEM_POOL_SIZE
#define APPMEM_POOL_SIZE BR_APP_TOTAL_SIZE
#endif
#endif
#ifdef __J2ME__
#define APPMEM_JAVA_POOL_SIZE DEFAULTHEAPSIZE
#if APPMEM_JAVA_POOL_SIZE > APPMEM_POOL_SIZE
#undef APPMEM_POOL_SIZE
#define APPMEM_POOL_SIZE APPMEM_JAVA_POOL_SIZE
#endif
#endif /* __J2ME__ */
/********* INSERT NEW APPLICATION HERE *********/
#ifdef __MMI_PHOTOEDITOR__
#if defined(__MMI_MAINLCD_240X320__)
#define APPMEM_PHOEDT_POOL_SIZE (240*320*2*2)
#elif defined(__MMI_MAINLCD_176X220__)
#define APPMEM_PHOEDT_POOL_SIZE (176*220*2*2)
#elif defined(__MMI_MAINLCD_128X160__)
#define APPMEM_PHOEDT_POOL_SIZE (128*160*2*2)
#elif defined(__MMI_MAINLCD_128X128__)
#define APPMEM_PHOEDT_POOL_SIZE (128*128*2*2)
#else
#define APPMEM_PHOEDT_POOL_SIZE (240*320*2*2)
#endif
#if APPMEM_PHOEDT_POOL_SIZE > APPMEM_POOL_SIZE
#undef APPMEM_POOL_SIZE
#define APPMEM_POOL_SIZE APPMEM_PHOEDT_POOL_SIZE
#endif
#endif /* __MMI_PHOTOEDITOR__ */
/*
* 1. APPLIB_MEM_AP_POOL_SIZE
*
* The size of the app-based ASM pool
*
* 2. APPLIB_MEM_AP_POOL_ALIGN
*
* Memory alignment of the app-based ASM pool
*
* If APPLIB_MEM_AP_POOL_ALIGN > 0, it set the alignment of the whole ASM pool.
* For example, we may need to align the pool to 256KB or 512KB for Java FBBR.
*
* If APPLIB_MEM_AP_POOL_ALIGN > 0, APPLIB_MEM_AP_POOL_SIZE should be exactly multiple of
* APPLIB_MEM_AP_POOL_ALIGN.
*
* For example: if APPLIB_MEM_AP_POOL_ALIGN = 512KB, and APPLIB_MEM_AP_POOL_SIZE = 512 + 2 KB,
* then the pool takes total 1024 KB, and it wastes 510 KB.
*/
#define APPMEM_ALIGN_TO_4(_x) (((_x) + 3) & ~3)
#if defined(__J2ME__) && defined(J2ME_ALIGN)
#define APPLIB_MEM_AP_POOL_ALIGN (J2ME_ALIGN)
#if APPMEM_POOL_SIZE > APPMEM_JAVA_POOL_SIZE
/* When some other app (e.g., 3D game) use more memory than Java */
/* Round to 256KB or 512KB */
#define APPMEM_POOL_SIZE_ALIGNED ((APPMEM_POOL_SIZE + APPLIB_MEM_AP_POOL_ALIGN - 1) / \
APPLIB_MEM_AP_POOL_ALIGN * APPLIB_MEM_AP_POOL_ALIGN)
#if (APPMEM_POOL_SIZE + 1024) > APPMEM_POOL_SIZE_ALIGNED
#error "Cannot reserve extra pool size for creating ADM heap allocator"
#endif
#define APPLIB_MEM_AP_POOL_SIZE (APPMEM_POOL_SIZE_ALIGNED)
#else /* APPMEM_POOL_SIZE > APPMEM_JAVA_POOL_SIZE */
/* When Java is the app that use the most memory in app-based ASM pool */
/* Do not add extra space because APPLIB_MEM_AP_POOL_SIZE is already multiple of
APPLIB_MEM_AP_POOL_ALIGN and Java does not use ADM with applib_mem_ap_alloc_full_pool(). */
#define APPLIB_MEM_AP_POOL_SIZE (APPMEM_ALIGN_TO_4(APPMEM_POOL_SIZE))
#endif /* APPMEM_POOL_SIZE > APPMEM_JAVA_POOL_SIZE */
#else /* defined(__J2ME__) && defined(J2ME_ALIGN) */
#define APPLIB_MEM_AP_POOL_ALIGN (4)
/* Add extra space for ADM internal data structures.
(Assume that there are at most 10 concurrent memory blocks) */
#define APPLIB_MEM_AP_POOL_SIZE (APPMEM_ALIGN_TO_4(APPMEM_POOL_SIZE) + APPLIB_MEM_GET_POOL_EXTRA_SIZE(10))
#endif /* defined(__J2ME__) && defined(J2ME_ALIGN) */
#endif /* APP_MEM_CONFIG_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -