Changeset 570:b66e5f9178f9
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r490
|
r570
|
|
| 1 | | /* Copyright (C) 2007 the NxOS developers |
| | 1 | /* Copyright (c) 2007,2008 the NxOS developers |
| 2 | 2 | * |
| 3 | 3 | * See AUTHORS for a full list of the developers. |
| … |
… |
|
| 23 | 23 | #include "base/_tlsf.c.inc" |
| 24 | 24 | |
| | 25 | inline 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 | |
| 25 | 30 | void nx_memalloc_init(void) { |
| 26 | 31 | 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"); |
| 32 | 32 | } |
| 33 | 33 | |
-
|
r489
|
r570
|
|
| 3 | 3 | */ |
| 4 | 4 | |
| 5 | | /* Copyright (C) 2007 the NxOS developers |
| | 5 | /* Copyright (c) 2007,2008 the NxOS developers |
| 6 | 6 | * |
| 7 | 7 | * See AUTHORS for a full list of the developers. |
| … |
… |
|
| 34 | 34 | * other functions of the allocator assume that the allocator is |
| 35 | 35 | * 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). |
| 36 | 42 | */ |
| 37 | 43 | /*@{*/ |
| … |
… |
|
| 40 | 46 | /*@{*/ |
| 41 | 47 | |
| 42 | | /* Initialize the allocator's memory pool. |
| | 48 | /** Initialize the allocator's memory pool. |
| 43 | 49 | * |
| 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. |
| 47 | 54 | * |
| 48 | 55 | * @sa nx_memalloc_init_full() |