summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-08-15 11:26:12 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-08-15 11:26:12 +0000
commitfae5b82d604779dd25ea8f1dcaa5a543eff86531 (patch)
tree8d1ae52410586c2bce14ba96f63212356a2c431b /apps
parent71a8492a690f9fe727b588ee3a009f84a7864f91 (diff)
downloadrockbox-fae5b82d604779dd25ea8f1dcaa5a543eff86531.zip
rockbox-fae5b82d604779dd25ea8f1dcaa5a543eff86531.tar.gz
rockbox-fae5b82d604779dd25ea8f1dcaa5a543eff86531.tar.bz2
rockbox-fae5b82d604779dd25ea8f1dcaa5a543eff86531.tar.xz
Now doesn't truncate the lenght when comparing path components
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1757 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
0 files changed, 0 insertions, 0 deletions
sion. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #include "plugin.h" #include "rockmalloc.h" #include "malloc.c" void *rocklua_morecore(int size) { static char *sbrk_top = NULL; static ssize_t total_size = 0; void *ptr = 0; if (size > 0) { size = size + 4 - (size % 4); if (sbrk_top == NULL) { sbrk_top = rb->plugin_get_buffer((size_t *) &total_size); } if (sbrk_top == NULL || size + 4 > abs(total_size)) { /* Try the audio buffer */ sbrk_top = rb->plugin_get_audio_buffer((size_t *) &total_size); if(sbrk_top == NULL || size + 4 > abs(total_size)) { printf("malloc failed for %d!\n", size); return (void *) MFAIL; } } ptr = sbrk_top + 4; *((unsigned int *) sbrk_top) = size; sbrk_top += size + 4; total_size -= size + 4; return ptr; } else if (size < 0) { /* we don't currently support shrink behavior */ return (void *) MFAIL; } else { return sbrk_top; } }