Changeset 570:b66e5f9178f9

Show
Ignore:
Timestamp:
06/02/08 01:30:18 (7 months ago)
Author:
David Anderson <dave@…>
Branch:
default
Message:

Tighten up the memory allocator documentation.

Update copyright notices in consequence.

Location:
nxos/base
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • nxos/base/memalloc.c

    r490 r570  
    1 /* Copyright (C) 2007 the NxOS developers 
     1/* Copyright (c) 2007,2008 the NxOS developers 
    22 * 
    33 * See AUTHORS for a full list of the developers. 
     
    2323#include "base/_tlsf.c.inc" 
    2424 
     25inline void nx_memalloc_init_full(void *mem_pool, U32 mem_pool_size) { 
     26  size_t size = init_memory_pool(mem_pool_size, mem_pool); 
     27  NX_ASSERT_MSG(size > 0, "Failed to init\nmemory allocator"); 
     28} 
     29 
    2530void nx_memalloc_init(void) { 
    2631  nx_memalloc_init_full(NX_USERSPACE_START, NX_USERSPACE_SIZE); 
    27 } 
    28  
    29 void nx_memalloc_init_full(void *mem_pool, U32 mem_pool_size) { 
    30   size_t size = init_memory_pool(mem_pool_size, mem_pool); 
    31   NX_ASSERT_MSG(size > 0, "Failed to init\nmemory allocator"); 
    3232} 
    3333 
  • nxos/base/memalloc.h

    r489 r570  
    33 */ 
    44 
    5 /* Copyright (C) 2007 the NxOS developers 
     5/* Copyright (c) 2007,2008 the NxOS developers 
    66 * 
    77 * See AUTHORS for a full list of the developers. 
     
    3434 * other functions of the allocator assume that the allocator is 
    3535 * initialized. 
     36 * 
     37 * @warning The memory allocator is @b not safe for concurrent 
     38 * access. You must provide your own locking around it if you are 
     39 * going to use it from concurrent contexts. Also be aware that this 
     40 * means you cannot use the allocator from within interrupt handlers 
     41 * (accessing already allocated memory is fine). 
    3642 */ 
    3743/*@{*/ 
     
    4046/*@{*/ 
    4147 
    42 /* Initialize the allocator's memory pool. 
     48/** Initialize the allocator's memory pool. 
    4349 * 
    44  * After this call, the memory defined in memmap.h as userspace 
    45  * (NX_USERSPACE_START through NX_USERSPACE_END) should no longer be 
    46  * used directly, since it is under the control of the memory allocator. 
     50 * After this call, the memory defined in memmap.h as userspace (@a 
     51 * NX_USERSPACE_START through @a NX_USERSPACE_END) should no longer be 
     52 * used directly, since it is under the control of the memory 
     53 * allocator. 
    4754 * 
    4855 * @sa nx_memalloc_init_full()