12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- /*
- * Copyright 2011 Institute of Communication and Computer Systems (ICCS)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
- /**
- * \file single_allocator.h
- * \author Ioannis Koutras (joko@microlab.ntua.gr)
- * \date September, 2011
- * Basic structures needed for the dmmlib allocator.
- */
- #ifndef SINGLE_ALLOCATOR_H
- #define SINGLE_ALLOCATOR_H
- #include <dmmlib/pool.h>
- /* In case stdlib.h is used, there is no need to redeclare
- * malloc() and free()
- */
- /**
- * Allocates size bytes by using the system's allocator.
- * \param size Requested allocation size in bytes.
- */
- void *dmmlib_malloc(size_t size);
- /**
- * De-allocates the memory space pointed to by ptr.
- * \param ptr The pointer to memory to free.
- */
- void dmmlib_free(void *ptr);
- /**
- * Try to change the size of an allocation
- * \param ptr The pointer to the data part of the original memory block.
- * \param size The new desired size of the block.
- *
- * \return The pointer to the data part of the memory block which
- * has the new, desired size.
- */
- void * dmmlib_realloc(void *ptr, size_t size);
- /** Global variable storing allocator's settings */
- allocator_t systemallocator;
- #endif /* SINGLE_ALLOCATOR_H */
|