| tnzr |
does anyone happen to know what
std::allocator.allocate() does when you try to allocate 0 bytes? I
get a pointer back but I can't tell what it's pointing at and I
can't seem to find anything on the web that gives a difinitive
answer |
| GeDaMo |
Why are you allocating zero bytes? |
| Billiard |
tnzr: the same thing it always returns |
| tnzr |
GeDaMo: we are implementing our own allocator for
an assignment, and when asked what we should do if the user tries
to allocate 0 bytes, the prof said to find out what std::allocator
does and mimic that |
| GeDaMo |
http://stackoverflow.com/questions/6065814/standard-compliant-custom-allocator |
| tnzr |
oh snap, thanks GeDaMo |
| GeDaMo |
:) |
| rindolf |
GeDaMo: zero bytes are enough to hold the Complete
Works of Shakespeare. |
| GeDaMo |
Depends on how many monkeys you have to decompress
it :P |
| rindolf |
GeDaMo: heh. |
| rindolf |
Of course, I defined a custom decompressor that
emits the complete works of Shakespeare on empty input and uses
gzip compression otherwise. |
| rindolf |
It's pretty large though. |
| Billiard |
redeemed: compress the decompressor using the same
algo |
| Billiard |
errr rindolf |
| rindolf |
Billiard: OK. |
| rindolf |
Billiard: heh. |
| Billiard |
0 bytes = a decompressor for the entire works of
shakespeare |