summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bd294f1)
We can have a 0 byte in the *middle* of an encoding.
static unsigned long find_free_end(unsigned char *arr, unsigned long arrsize)
{
static unsigned long find_free_end(unsigned char *arr, unsigned long arrsize)
{
- for (end = 0; end < arrsize; end++) {
- if (!arr[end])
- break;
+ for (i = arrsize-1; i >= 0; i--) {
+ if (arr[i])
+ return i + 1;
}
void *tiny_alloc_get(void *pool, unsigned long poolsize,
}
void *tiny_alloc_get(void *pool, unsigned long poolsize,