Skip to content

Commit 03a3f54

Browse files
committed
Mark functions as inline
Correctly mark `ext_allocator_memdup` and `ext_allocator_strdup` inline.
1 parent 8f5bb74 commit 03a3f54

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

extlib.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
*
4444
* Changelog:
4545
*
46+
* v2.0.1:
47+
* Correctly mark `ext_allocator_memdup` and `ext_allocator_strdup` inline.
48+
*
4649
* v2.0.0:
4750
* - Breaking changes on hashmap implementation:
4851
* Reworked the hashmap implementation to make possible the usage of `ext_hmap_get` and
@@ -607,7 +610,7 @@ inline void ext_free(void *ptr, size_t size) {
607610
}
608611

609612
// Copies a cstring by using the provided allocator
610-
char *ext_allocator_strdup(Ext_Allocator *a, const char *s) {
613+
inline char *ext_allocator_strdup(Ext_Allocator *a, const char *s) {
611614
size_t len = strlen(s);
612615
char *res = a->alloc(a, len + 1);
613616
memcpy(res, s, len);
@@ -616,7 +619,7 @@ char *ext_allocator_strdup(Ext_Allocator *a, const char *s) {
616619
}
617620

618621
// Copies a memory region of `size` bytes by using the provided allocator
619-
void *ext_allocator_memdup(Ext_Allocator *a, const void *mem, size_t size) {
622+
inline void *ext_allocator_memdup(Ext_Allocator *a, const void *mem, size_t size) {
620623
return memcpy(a->alloc(a, size), mem, size);
621624
}
622625

0 commit comments

Comments
 (0)