Make allocator get function names more consistent

This commit is contained in:
Justin R. Cutler 2016-04-04 11:09:27 -04:00
parent cc12de9414
commit 0ee13cea80
5 changed files with 10 additions and 8 deletions

View File

@ -48,7 +48,7 @@ static allocator_t default_allocator = {
};
allocator_t *allocator_get_default(void)
allocator_t *default_allocator_get(void)
{
return &default_allocator;
}

View File

@ -133,7 +133,7 @@ static allocator_t mmap_allocator = {
};
allocator_t *allocator_get_mmap(void)
allocator_t *mmap_allocator_get(void)
{
return &mmap_allocator;
}

View File

@ -16,10 +16,12 @@
/* EXIT_SUCCESS, EXIT_FAILURE */
#include <stdlib.h>
/* allocator_t, allocator_get_default, allocator_destroy */
/* allocator_t, allocator_destroy */
#include <threadless/allocation.h>
/* default_allocator_get */
#include <threadless/default_allocator.h>
#ifdef HAVE_MMAP
/* allocator_get_mmap */
/* mmap_allocator_get */
# include <threadless/mmap_allocator.h>
#endif
/* ... */
@ -106,14 +108,14 @@ int main(int argc, char *argv[])
(void) argv;
printf("default allocator:\n");
allocator = allocator_get_default();
allocator = default_allocator_get();
error = run(allocator);
allocator_destroy(allocator);
#ifdef HAVE_MMAP
if (!error) {
printf("mmap allocator:\n");
allocator = allocator_get_mmap();
allocator = mmap_allocator_get();
error = run(allocator);
allocator_destroy(allocator);
}

View File

@ -20,7 +20,7 @@ extern "C" {
/** Get default allocator instance
* @returns default allocator
*/
allocator_t *allocator_get_default(void);
allocator_t *default_allocator_get(void);
#ifdef __cplusplus
}

View File

@ -20,7 +20,7 @@ extern "C" {
/** Get @c mmap(3) allocator instance
* @returns default allocator
*/
allocator_t *allocator_get_mmap(void);
allocator_t *mmap_allocator_get(void);
#ifdef __cplusplus
}