Memory allocation and C compatibility

被引:0
|
作者
AT&T Research [1 ]
机构
来源
关键词
Allocation compatibility - Free function - Malloc function;
D O I
暂无
中图分类号
学科分类号
摘要
The standard way of allocating memory in C involves a `malloc' function that allocates memory and a `free' function that frees it. Portability constraints on `malloc' and `free' preclude using the length information those functions must store to determine how many C objects to destroy. This means that C implementations must be able to store the length somewhere else. Because auxiliary storage can only be used for arrays, programmers must state whether they are freeing scalars or arrays, but not how many elements there are in the array. Combining these rules constrains the design of C memory allocation facilities. Fortunately, these constraints are not hard to live with in practice, and is possible to implement in ways that are portable and useful.
引用
收藏
相关论文
共 50 条
  • [1] Memory allocation and C compatibility
    Koenig, A
    JOURNAL OF OBJECT-ORIENTED PROGRAMMING, 1996, 9 (02): : 42 - &
  • [2] ENCAPSULATING C-MEMORY ALLOCATION
    SCHIMANDLE, J
    DR DOBBS JOURNAL, 1990, 15 (08): : 24 - &
  • [3] MemExplorer: From C Code to Memory Allocation
    Laurent, Johann
    Rossi, Andre
    Sevaux, Marc
    JOURNAL OF LOW POWER ELECTRONICS, 2012, 8 (04) : 394 - 402
  • [4] MEMORY ALLOCATION COSTS IN LARGE C-PROGRAM AND C++ PROGRAM
    DETLEFS, D
    DOSSER, A
    ZORN, B
    SOFTWARE-PRACTICE & EXPERIENCE, 1994, 24 (06): : 527 - 542
  • [5] Memory Allocation
    Paul W Frankland
    Sheena A Josselyn
    Neuropsychopharmacology, 2015, 40 : 243 - 243
  • [6] MEMORY ALLOCATION
    PRASAD, M
    DR DOBBS JOURNAL, 1990, 15 (12): : 12 - &
  • [7] Memory Allocation
    Frankland, Paul W.
    Josselyn, Sheena A.
    NEUROPSYCHOPHARMACOLOGY, 2015, 40 (01) : 243 - 243
  • [8] Flash memory electromagnetic compatibility
    Fogle, Adam D.
    Darling, Don
    Blish, Richard C., II
    Daszko, Gene
    IEEE TRANSACTIONS ON DEVICE AND MATERIALS RELIABILITY, 2006, 6 (02) : 266 - 276
  • [9] Effective Memory Access Optimization by Memory Delay Modeling, Memory Allocation, and Buffer Allocation
    Khan, Sultan Daud
    Shin, Hyunchul
    2009 INTERNATIONAL SOC DESIGN CONFERENCE (ISOCC 2009), 2009, : 153 - 156
  • [10] Efficient memory allocation
    Gontmakher, S
    Horn, I
    DR DOBBS JOURNAL, 1999, 24 (01): : 116 - 119