Skip to content
Myr

Merge branch 'stbds_custom_free_fix' of https://github.com/avennstrom/stb into foo

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parents 6b647c0, 579ace2 · Browse files · 1 file+8 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−1 removed

  • other:+8 added−1 removed

1 file+8 added−1 removed

modified:stb_ds.h+8 added-1 removed
378 unmodified lines
379 Andreas Molzer380 github:hashitaku381 github:srdjanstipic382 Macoy Madson383 Andreas Vennstrom384*/385386#ifdef STBDS_UNIT_TESTS387#define _CRT_SECURE_NO_WARNINGS
102 unmodified lines
490// Everything below here is implementation details491//492493extern void * stbds_arrgrowf(void *a, size_t elemsize, size_t addlen, size_t min_cap);494extern void stbds_arrfreef(void *a);495extern void stbds_hmfree_func(void *p, size_t elemsize);496extern void * stbds_hmget_key(void *a, size_t elemsize, void *key, size_t keysize, int mode);497extern void * stbds_hmget_key_ts(void *a, size_t elemsize, void *key, size_t keysize, ptrdiff_t *temp, int mode);498extern void * stbds_hmput_default(void *a, size_t elemsize);
46 unmodified lines
545#define stbds_arraddn(a,n) ((void)(stbds_arraddnoff(a, n))) // deprecated, use one of the following instead:546#define stbds_arraddnptr(a,n) (stbds_arrmaybegrow(a,n), stbds_header(a)->length += (n), &(a)[stbds_header(a)->length-(n)])547#define stbds_arraddnoff(a,n) (stbds_arrmaybegrow(a,n), stbds_header(a)->length += (n), stbds_header(a)->length-(n))548#define stbds_arrlast(a) ((a)[stbds_header(a)->length-1])547#define stbds_arrfree(a) ((void) ((a) ? STBDS_FREE(NULL,stbds_header(a)) : (void)0), (a)=NULL)549#define stbds_arrfree(a) ((void) ((a) ? stbds_arrfreef(a) : (void)0), (a)=NULL)550#define stbds_arrdel(a,i) stbds_arrdeln(a,i,1)551#define stbds_arrdeln(a,i,n) (memmove(&(a)[i], &(a)[(i)+(n)], sizeof *(a) * (stbds_header(a)->length-(n)-(i))), stbds_header(a)->length -= (n))552#define stbds_arrdelswap(a,i) ((a)[i] = stbds_arrlast(a), stbds_header(a)->length -= 1)553#define stbds_arrinsn(a,i,n) ((a)?stbds_temp(a)=(i):0,stbds_arraddn((a),(n)), memmove(&(a)[stbds_temp(a)+(n)], &(a)[stbds_temp(a)], sizeof *(a) * (stbds_header(a)->length-(n)-stbds_temp(a))))
240 unmodified lines
794795 return b;796}797798void stbds_arrfreef(void *a)799{800 STBDS_FREE(NULL, stbds_header(a));801}802803//804// stbds_hm hash table implementation805//806
1087 unmodified lines