- #include <iostream>
- #include <stdlib.h>
- #include <string.h>
- #include <stdio.h>
- #if 1
- #include <ext/bitmap_allocator.h>
- __gnu_cxx::bitmap_allocator<char> testAllocator;
- #else
- #include <ext/mt_allocator.h>
- __gnu_cxx::__mt_alloc<char> testAllocator;
- #endif
- using namespace std;
- int main(int argc, char *argv[])
- {
- (void)puts("# start.");
- char *s = testAllocator.allocate(512);
- (void)strcpy(s, "frog attack");
- (void)printf("|%s|\n", s);
- testAllocator.deallocate(s, 512);
- (void)puts("# end.");
- return 0;
- }
__gnu_cxx::bitmap_allocator demo #002
Posted by Anonymous on Wed 22nd Jun 2022 09:08
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.