ucx/mempool.h

changeset 70
88092b88ec00
parent 40
a95ee94b9204
child 110
53895e9a4bbb
equal deleted inserted replaced
69:0dbdd7e8c1fc 70:88092b88ec00
1 /* 1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 * 3 *
4 * Copyright 2013 Olaf Wintermann. All rights reserved. 4 * Copyright 2014 Olaf Wintermann. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met: 7 * modification, are permitted provided that the following conditions are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
119 */ 119 */
120 void *ucx_mempool_malloc(UcxMempool *pool, size_t n); 120 void *ucx_mempool_malloc(UcxMempool *pool, size_t n);
121 /** 121 /**
122 * Allocates a pooled memory array. 122 * Allocates a pooled memory array.
123 * 123 *
124 * The contents of the allocated memory is set to zero. 124 * The content of the allocated memory is set to zero.
125 * 125 *
126 * @param pool the memory pool 126 * @param pool the memory pool
127 * @param nelem amount of elements to allocate 127 * @param nelem amount of elements to allocate
128 * @param elsize amount of memory per element 128 * @param elsize amount of memory per element
129 * @return a pointer to the allocated memory 129 * @return a pointer to the allocated memory
140 * and exit the program with error code <code>EXIT_FAILURE</code>. 140 * and exit the program with error code <code>EXIT_FAILURE</code>.
141 * 141 *
142 * @param pool the memory pool 142 * @param pool the memory pool
143 * @param ptr a pointer to the memory that shall be reallocated 143 * @param ptr a pointer to the memory that shall be reallocated
144 * @param n the new size of the memory 144 * @param n the new size of the memory
145 * @return a pointer to the the location of the memory 145 * @return a pointer to the new location of the memory
146 * @see ucx_allocator_realloc() 146 * @see ucx_allocator_realloc()
147 */ 147 */
148 void *ucx_mempool_realloc(UcxMempool *pool, void *ptr, size_t n); 148 void *ucx_mempool_realloc(UcxMempool *pool, void *ptr, size_t n);
149 149
150 /** 150 /**

mercurial