Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce calls to malloc in map #101

Merged
merged 1 commit into from
Aug 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,11 @@ unordered_map unordered_map_destroy(unordered_map me);
typedef struct internal_map *map;

/* Starting */
map map_init(size_t key_size,
size_t value_size,
map map_init(size_t key_size, size_t value_size,
int (*comparator)(const void *const one, const void *const two));

/* Capacity */
int map_size(map me);
size_t map_size(map me);
int map_is_empty(map me);

/* Accessing */
Expand Down
7 changes: 3 additions & 4 deletions src/include/map.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2019 Bailey Thompson
* Copyright (c) 2017-2020 Bailey Thompson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -32,12 +32,11 @@
typedef struct internal_map *map;

/* Starting */
map map_init(size_t key_size,
size_t value_size,
map map_init(size_t key_size, size_t value_size,
int (*comparator)(const void *const one, const void *const two));

/* Capacity */
int map_size(map me);
size_t map_size(map me);
int map_is_empty(map me);

/* Accessing */
Expand Down
Loading