Messages in this thread | | | Date | Sat, 10 Jan 2004 20:42:13 -0800 (PST) | From | john moser <> | Subject | krealloc() |
| |
Why is there no krealloc()? I'm not sure if I should just call mmap() inside the kernel (any security hazzards or whatnot I should be worried about there?), but it's going to be a pain to resize arrays. realloc() is usually:
void *realloc(void *block, size_t size);
I'm thinking krealloc would be the same, since we'd have the old GFP_* flags and the old size:
void *krealloc(void *block, size_t size);
Most realloc() implimentations grow or shrink in place, if possible. If they can't, or if that wasn't how they were coded, they allocate the new block, memcpy() over, then free the old block.
I have nowhere near the skill or experience needed to impliment any sort of krealloc(), so for now I'm going to have to do bad hacks in my code. Can someone please impliment a krealloc() by 2.6.2? Or at least slate it for SOME time in the future, if not immediately now.
_____________________________________________________________ Linux.Net -->Open Source to everyone Powered by Linare Corporation http://www.linare.com/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |